Пример #1
0
    def test_genattrib_zip_with_filter(self):
        self.maxDiff = None
        # note: this contains an about_files subdir that is the root of all ABOUT files in the "project"
        about_dir = 'about_code_tool/tests/testdata/genattrib/about_files.zip'
        generated_attrib = get_temp_file('generated.html')
        # note: all the about_files columns are paths starting with /about_files
        filter_csv = 'about_code_tool/tests/testdata/genattrib/project_filter.csv'
        args = [about_dir, generated_attrib, filter_csv]
        options = None
        genattrib_command_tester(args, options)
        result = open(generated_attrib).read()
        expected = [
            'ElasticSearch 1.6.0',
            'bootstrap 2.3.2',
        ]
        for ex in expected:
            self.assertTrue(ex in result, ex)

        not_expected = [
            'Annotator 1.2.10',
            'component_4',
            'djangosnippets.org_2413 2011-04-12',
        ]
        for ex in not_expected:
            self.assertFalse(ex in result, ex)
Пример #2
0
 def test_write_licenses(self):
     gen = genabout.GenAbout()
     license_text_file = test_about.get_temp_file()
     license_text = 'This is a test.'
     test = [[license_text_file, license_text]]
     gen.write_licenses(test)
     result = open(license_text_file, 'rU').readlines()
     self.assertEqual([license_text], result)
Пример #3
0
 def test_genattrib_basic(self):
     self.maxDiff = None
     about_dir = 'about_code_tool/tests/testdata/genattrib/basic/'
     generated_attrib = get_temp_file('generated.html')
     args = [about_dir, generated_attrib]
     options = None
     genattrib_command_tester(args, options)
     result = open(generated_attrib).read()
     expected = [
         'ElasticSearch 1.6.0',
         'bootstrap 2.3.2',
         'djangosnippets.org_2413 2011-04-12',
         'Annotator 1.2.10',
         'component_4',
     ]
     for ex in expected:
         self.assertTrue(ex in result)