def test_package_path(self): self.assertEqual(os.path.join('com', 'pants', 'example', 'tests'), AaptGen.package_path('com.pants.example.tests')) with self.assertRaises(AssertionError): self.assertEqual(os.path.join('com', 'pants', 'example', 'tests'), AaptGen.package_path('com.pants-example.tests')) with self.assertRaises(AssertionError): self.assertEqual(os.path.join('com', 'pants', 'example', 'tests'), AaptGen.package_path('com.pants.example'))
def test_relative_genfile(self): with self.android_binary(package_name="org.pantsbuild.examples.hello") as binary: self.assertEqual( AaptGen._relative_genfile(binary), os.path.join("org", "pantsbuild", "examples", "hello", "R.java") )
def assert_files(self, package, expected_file): self.assertEqual(AaptGen._calculate_genfile(package), expected_file)