Example #1
0
  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'))
Example #2
0
 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")
         )
Example #3
0
 def assert_files(self, package, expected_file):
   self.assertEqual(AaptGen._calculate_genfile(package), expected_file)
Example #4
0
 def assert_files(self, package, expected_file):
   self.assertEqual(AaptGen._calculate_genfile(package), expected_file)