aea2747cda25271b788d670b8e65452b24bed4e0,tests/python/pants_test/android/tasks/test_unpack_libraries.py,UnpackLibrariesTest,test_unpack_aar_files_and_invalidation,#UnpackLibrariesTest#,283

Before Change


  def test_unpack_aar_files_and_invalidation(self):
    with temporary_dir() as temp:
      aar = self.create_aarfile(temp, "org.pantsbuild.android.test")
      self.create_unpack_build_file()

      target_name = "unpack:test"
      self._make_android_dependency("test-jar", aar, "1.0")
      files = self.unpack_libraries(target_name, aar)
      self.assertIn("Foo.class", files)

      // Reset build graph to dismiss all the created targets.
      self.reset_build_graph()

      // Create a new copy of the archive- adding a sentinel file but without bumping the version.
      new_aar = self.create_aarfile(temp, "org.pantsbuild.android.test",
                                    filenames=["a/b/c/Baz.class"])

      // Call task a 2nd time but the sentinel file is not found because we didn"t bump version.
      files = self.unpack_libraries(target_name, new_aar)
      self.assertNotIn("Baz.class", files)

      // Now bump version and this time the aar is unpacked and the sentinel file is found.
      self.reset_build_graph()
      self._make_android_dependency("test-jar", new_aar, "2.0")
      files = self.unpack_libraries(target_name, new_aar)
      self.assertIn("Baz.class", files)

After Change



      // Now bump version and this time the aar is unpacked and the sentinel file is found.
      self.reset_build_graph()
      lib, coordinate = self.create_android_library(rev="2.0", library_file=aar)
      files = self.unpack_libraries(target=lib, aar_file=new_aar, coordinate=coordinate)
      self.assertIn("Baz.class", files)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pantsbuild/pants
Commit Name: aea2747cda25271b788d670b8e65452b24bed4e0
Time: 2015-09-17
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/android/tasks/test_unpack_libraries.py
Class Name: UnpackLibrariesTest
Method Name: test_unpack_aar_files_and_invalidation


Project Name: pantsbuild/pants
Commit Name: aea2747cda25271b788d670b8e65452b24bed4e0
Time: 2015-09-17
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/android/tasks/test_unpack_libraries.py
Class Name: UnpackLibrariesTest
Method Name: test_unpack_aar_files_and_invalidation


Project Name: pantsbuild/pants
Commit Name: aea2747cda25271b788d670b8e65452b24bed4e0
Time: 2015-09-17
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/android/tasks/test_unpack_libraries.py
Class Name: UnpackLibrariesTest
Method Name: test_unpack_jar_library


Project Name: pantsbuild/pants
Commit Name: aea2747cda25271b788d670b8e65452b24bed4e0
Time: 2015-09-17
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/android/tasks/test_unpack_libraries.py
Class Name: UnpackLibrariesTest
Method Name: test_unexpected_archive_type