Bugs, blueprints and answers needs attachments to be inserted in comments. Currently to limit the size bug comments attachments there's a validator in `canonical.launchpad.validators.bugattachments`. It wouldn't be useful to create new validators that do the same thing in the same way for blueprints and answers too.
== Pre-implementation notes ==
I've discussed this change with sinzui and he agreed.
== Implementation details ==
With this branch I've renamed `bugattachments` to `attachments`, making it more generic. I've also renamed the function `bug_attachment_size_constraint()` to `attachment_size_constraint()` and the configuration item `max_bug_attachment_size` to `max_attachment_size`.
Running canonical.testing.layers.LaunchpadFunctionalLayer tests:
Set up canonical.testing.layers.BaseLayer in 0.004 seconds.
Set up canonical.testing.layers.DatabaseLayer in 0.806 seconds.
Set up canonical.testing.layers.LibrarianLayer in 9.755 seconds.
Set up canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
Set up canonical.testing.layers.FunctionalLayer in 7.743 seconds.
Set up canonical.testing.layers.GoogleServiceLayer in 1.539 seconds.
Set up canonical.testing.layers.LaunchpadFunctionalLayer in 0.000 seconds.
Running:
lib/lp/bugs/tests/../doc/bugattachments.txt
Ran 27 tests with 0 failures and 0 errors in 6.076 seconds.
Running canonical.testing.layers.PageTestLayer tests:
Set up canonical.testing.layers.PageTestLayer in 0.001 seconds.
Running:
lib/lp/bugs/tests/../stories/bugs/xx-bug-comment-attach-file.txt
Ran 8 tests with 0 failures and 0 errors in 20.382 seconds.
Tearing down left over layers:
Tear down canonical.testing.layers.PageTestLayer in 0.000 seconds.
Tear down canonical.testing.layers.LaunchpadFunctionalLayer in 0.000 seconds.
Tear down canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
Tear down canonical.testing.layers.LibrarianLayer in 0.410 seconds.
Tear down canonical.testing.layers.GoogleServiceLayer in 0.087 seconds.
Tear down canonical.testing.layers.FunctionalLayer ... not supported
Tear down canonical.testing.layers.DatabaseLayer in 0.048 seconds.
Tear down canonical.testing.layers.BaseLayer in 0.000 seconds.
Total: 35 tests, 0 failures, 0 errors in 48.292 seconds.
= Summary =
Bugs, blueprints and answers needs attachments to be inserted in comments. Currently to limit the size bug comments attachments there's a validator in `canonical. launchpad. validators. bugattachments` . It wouldn't be useful to create new validators that do the same thing in the same way for blueprints and answers too.
== Pre-implementation notes ==
I've discussed this change with sinzui and he agreed.
== Implementation details ==
With this branch I've renamed `bugattachments` to `attachments`, making it more generic. I've also renamed the function `bug_attachment _size_constrain t()` to `attachment_ size_constraint ()` and the configuration item `max_bug_ attachment_ size` to `max_attachment _size`.
== Tests ==
$ bin/test -vv -t lib/lp/ bugs/tests/ ../stories/ bugs/xx- bug-comment- attach- file.txt -t lib/lp/ bugs/tests/ ../doc/ bugattachments. txt
Running tests at level 1
Running canonical. testing. layers. LaunchpadFuncti onalLayer tests: testing. layers. BaseLayer in 0.004 seconds. testing. layers. DatabaseLayer in 0.806 seconds. testing. layers. LibrarianLayer in 9.755 seconds. testing. layers. LaunchpadLayer in 0.000 seconds. testing. layers. FunctionalLayer in 7.743 seconds. testing. layers. GoogleServiceLa yer in 1.539 seconds. testing. layers. LaunchpadFuncti onalLayer in 0.000 seconds. bugs/tests/ ../doc/ bugattachments. txt testing. layers. PageTestLayer tests: testing. layers. PageTestLayer in 0.001 seconds. bugs/tests/ ../stories/ bugs/xx- bug-comment- attach- file.txt testing. layers. PageTestLayer in 0.000 seconds. testing. layers. LaunchpadFuncti onalLayer in 0.000 seconds. testing. layers. LaunchpadLayer in 0.000 seconds. testing. layers. LibrarianLayer in 0.410 seconds. testing. layers. GoogleServiceLa yer in 0.087 seconds. testing. layers. FunctionalLayer ... not supported testing. layers. DatabaseLayer in 0.048 seconds. testing. layers. BaseLayer in 0.000 seconds.
Set up canonical.
Set up canonical.
Set up canonical.
Set up canonical.
Set up canonical.
Set up canonical.
Set up canonical.
Running:
lib/lp/
Ran 27 tests with 0 failures and 0 errors in 6.076 seconds.
Running canonical.
Set up canonical.
Running:
lib/lp/
Ran 8 tests with 0 failures and 0 errors in 20.382 seconds.
Tearing down left over layers:
Tear down canonical.
Tear down canonical.
Tear down canonical.
Tear down canonical.
Tear down canonical.
Tear down canonical.
Tear down canonical.
Tear down canonical.
Total: 35 tests, 0 failures, 0 errors in 48.292 seconds.
== lint ==
`make lint` did not return any error in my code.