def test_encoded_value(self, tmpdir_factory, byte_values, expected): fn = str(tmpdir_factory.mktemp('data').join('data.txt')) with open(fn, 'wb') as f: if sys.version_info >= (3, ): f.write(bytes(byte_values)) else: f.write(bytearray(byte_values)) f.close() bytestream = ByteStream(fn) assert DexParser.EncodedValue(bytestream).value == expected
def test_apk_parsing_filtered_empty_result(self): tests = DexParser.parse(TEST_APK, ["com.linkedin.mdctestNOT"]) assert not list(tests)
def test_apk_parsing(self): tests = DexParser.parse(TEST_APK) assert sorted(tests) == TestDexParsing.EXPECTED_TESTS
def test_apk_parsing_filtered(self): tests = DexParser.parse(TEST_APK, ["com.linkedin.mdctest"]) assert sorted(tests) == TestDexParsing.EXPECTED_TESTS
def test_apk_parsing_filtered_regex(self): tests = DexParser.parse(TEST_APK, ["re::com\.linkedin\.mdct.st[s]*"]) assert sorted(tests) == TestDexParsing.EXPECTED_TESTS