def test_marks_resource_as_save_to_remove(self):
     actual = clean_app.parse_lint_result(
         './test/android_app/lint-result.xml',
         './test/android_app/AndroidManifest.xml')
     remove_entire_file = list(
         filter(lambda issue: issue.remove_file, actual))
     self.assertEqual(11, len(remove_entire_file))
 def test_marks_resource_as_not_save_to_remove_if_it_has_used_values(self):
     actual = clean_app.parse_lint_result(
         './test/android_app/lint-result.xml',
         './test/android_app/AndroidManifest.xml')
     not_remove_entire_file = list(
         filter(lambda issue: not issue.remove_file, actual))
     self.assertEqual(4, len(not_remove_entire_file))
 def test_extracts_correct_info_from_resource(self):
     issues = clean_app.parse_lint_result('./test/android_app/lint-result.xml')
     not_remove_entire_file = filter(lambda issue: not issue.remove_file, issues)
     actual = not_remove_entire_file[0]
     self.assertEqual('res\\values\\strings.xml', actual.filepath)
     self.assertGreater(len(actual.elements), 0)
     self.assertEqual(('string', 'missing'), actual.elements[0])
 def test_extracts_correct_info_from_resource(self):
     issues = clean_app.parse_lint_result('./test/android_app/lint-result.xml')
     not_remove_entire_file = list(filter(lambda issue: not issue.remove_file, issues))
     actual = list(filter(lambda issue: os.path.normpath(issue.filepath) == os.path.normpath(
         'res/values/strings.xml'), not_remove_entire_file))[0]
     self.assertGreater(len(actual.elements), 0)
     self.assertEqual(('string', 'missing'), actual.elements[0])
 def test_extracts_correct_info_from_resource(self):
     issues = clean_app.parse_lint_result('./test/android_app/lint-result.xml')
     not_remove_entire_file = list(filter(lambda issue: not issue.remove_file, issues))
     actual = list(filter(lambda issue: os.path.normpath(issue.filepath) == os.path.normpath(
         'res/values/strings.xml'), not_remove_entire_file))[0]
     self.assertGreater(len(actual.elements), 0)
     self.assertEqual(('string', 'missing'), actual.elements[0])
Beispiel #6
0
 def test_extracts_correct_info_about_extra_translations(self):
     issues = clean_app.parse_lint_result('./test/android_app/lint-result.xml',
                                          './test/android_app/AndroidManifest.xml')
     not_remove_entire_file = list(filter(lambda issue: not issue.remove_file, issues))
     issues = list(filter(lambda issue: os.path.normpath(issue.filepath) == os.path.normpath(
         'res/values-fr/strings.xml'), not_remove_entire_file))
     actual = map(lambda i: i.elements[0], issues)
     self.assertIn(('string', 'untranslatable'), actual)
 def test_reads_all_unused_resource_issues(self):
     actual = clean_app.parse_lint_result(
         './test/android_app/lint-result.xml',
         './test/android_app/AndroidManifest.xml')
     self.assertEqual(15, len(actual))
 def test_reads_all_unused_resource_issues(self):
     actual = clean_app.parse_lint_result('./test/android_app/lint-result.xml')
     self.assertEqual(12, len(actual))
 def test_marks_resource_as_not_save_to_remove_if_it_has_used_values(self):
     actual = clean_app.parse_lint_result('./test/android_app/lint-result.xml')
     not_remove_entire_file = filter(lambda issue: not issue.remove_file, actual)
     self.assertEqual(1, len(not_remove_entire_file))
 def test_marks_resource_as_save_to_remove(self):
     actual = clean_app.parse_lint_result('./test/android_app/lint-result.xml')
     remove_entire_file = filter(lambda issue: issue.remove_file, actual)
     self.assertEqual(11, len(remove_entire_file))
Beispiel #11
0
 def test_reads_untranslatable_extra_translation_issues(self):
     issues = clean_app.parse_lint_result('./test/android_app/lint-result.xml',
                                          './test/android_app/AndroidManifest.xml')
     actual = list(filter(lambda i: isinstance(i, clean_app.ExtraTranslationIssue), issues))
     self.assertEqual(1, len(actual))
Beispiel #12
0
 def test_reads_all_unused_resource_issues(self):
     issues = clean_app.parse_lint_result('./test/android_app/lint-result.xml',
                                          './test/android_app/AndroidManifest.xml')
     actual = list(filter(lambda i: isinstance(i, clean_app.UnusedResourceIssue), issues))
     self.assertEqual(15, len(actual))