Author: hwright
Date: Wed Aug 4 04:22:31 2010
New Revision: 982121
URL: http://svn.apache.org/viewvc?rev=982121&view=rev
Log:
Add full support for detecting and reporting binaries files in Mouse reports.
Also, add a couple of tests (derived from the RAT testsuite) to ensure correct
operation.
Added:
labs/mouse/tests/data/expected_output/binaries
labs/mouse/tests/data/expected_output/binaries.xml
Modified:
labs/mouse/match.py
labs/mouse/tests/test_mouse.py
Modified: labs/mouse/match.py
URL:
http://svn.apache.org/viewvc/labs/mouse/match.py?rev=982121&r1=982120&r2=982121&view=diff
==============================================================================
--- labs/mouse/match.py (original)
+++ labs/mouse/match.py Wed Aug 4 04:22:31 2010
@@ -63,7 +63,7 @@ class BinaryResult(object):
@staticmethod
def match(item):
- return False
+ return guesser.is_binary(item)
_match_order = [
Added: labs/mouse/tests/data/expected_output/binaries
URL:
http://svn.apache.org/viewvc/labs/mouse/tests/data/expected_output/binaries?rev=982121&view=auto
==============================================================================
--- labs/mouse/tests/data/expected_output/binaries (added)
+++ labs/mouse/tests/data/expected_output/binaries Wed Aug 4 04:22:31 2010
@@ -0,0 +1,37 @@
+
+*****************************************************
+Summary
+-------
+Notes: 0
+Binaries: 1
+Archives: 0
+Standards: 0
+
+Apache Licensed: 0
+Generated Documents: 0
+
+JavaDocs are generated and so license header is optional
+Generated files do not required license headers
+
+0 Unknown Licenses
+
+*******************************
+
+Unapproved licenses:
+
+
+*******************************
+
+Archives:
+
+*****************************************************
+ Files with Apache License headers will be marked AL
+ Binary files (which do not require AL headers) will be marked B
+ Compressed archives will be marked A
+ Notices, licenses etc will be marked N
+ B data/rat-tests/binaries/Image-png.not
+
+ *****************************************************
+ Printing headers for files without AL header...
+
+
\ No newline at end of file
Added: labs/mouse/tests/data/expected_output/binaries.xml
URL:
http://svn.apache.org/viewvc/labs/mouse/tests/data/expected_output/binaries.xml?rev=982121&view=auto
==============================================================================
--- labs/mouse/tests/data/expected_output/binaries.xml (added)
+++ labs/mouse/tests/data/expected_output/binaries.xml Wed Aug 4 04:22:31 2010
@@ -0,0 +1 @@
+<rat-report><resource name='data/rat-tests/binaries/Image-png.not'><type
name='binary'/></resource></rat-report>
\ No newline at end of file
Modified: labs/mouse/tests/test_mouse.py
URL:
http://svn.apache.org/viewvc/labs/mouse/tests/test_mouse.py?rev=982121&r1=982120&r2=982121&view=diff
==============================================================================
--- labs/mouse/tests/test_mouse.py (original)
+++ labs/mouse/tests/test_mouse.py Wed Aug 4 04:22:31 2010
@@ -122,6 +122,13 @@ class TestReport(unittest.TestCase):
def test_greek_vanilla(self):
self._check_plain_output('greek', 'greek_vanilla')
+ def test_binary_xml(self):
+ self._check_xml_output(os.path.join('rat-tests', 'binaries'),
+ 'binaries.xml')
+
+ def test_binary(self):
+ self._check_plain_output(os.path.join('rat-tests', 'binaries'), 'binaries')
+
# def test_rat_xml(self):
# self._check_xml_output('rat-tests', 'rat-tests.xml')
#
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]