def test_parse_items__skips_files(self): with temporary_dir() as path: # create files that should be ignored by the parser for filename in ( ".hidden", "CODEOWNERS", "OWNERS", "test.wrongext", "test-meta.xml", "Account.object", "Custom__c.object", ): touch(filename) parser = BaseMetadataParser("TestMDT", path, "object", delete=True) parser.parse_item = mock.Mock() parser.parse_items() parser.parse_item.assert_called_once()
def test_parse_items__skips_files(self): with temporary_dir() as path: # create files that should be ignored by the parser for filename in ( ".hidden", "CODEOWNERS", "OWNERS", "test.wrongext", "test-meta.xml", "Account.object", "Custom__c.object", ): with open(filename, "w"): pass parser = BaseMetadataParser("TestMDT", path, "object", delete=True) parser.parse_item = mock.Mock() parser.parse_items() parser.parse_item.assert_called_once()
def test_render_xml__no_members(self): parser = BaseMetadataParser("TestMDT", None, "object", delete=False) self.assertIsNone(parser.render_xml())
def test_parse_item(self): parser = BaseMetadataParser("TestMDT", None, "object", delete=False) with self.assertRaises(NotImplementedError): parser._parse_item("asdf")
def test_check_delete_excludes__not_deleting(self): parser = BaseMetadataParser("TestMDT", None, "object", delete=False) self.assertFalse(parser.check_delete_excludes("asdf"))
def test_render_xml__no_members(self): parser = BaseMetadataParser("TestMDT", None, "object", delete=False) self.assertIsNone(parser.render_xml())
def test_parse_item(self): parser = BaseMetadataParser("TestMDT", None, "object", delete=False) with self.assertRaises(NotImplementedError): parser._parse_item("asdf")
def test_check_delete_excludes__not_deleting(self): parser = BaseMetadataParser("TestMDT", None, "object", delete=False) self.assertFalse(parser.check_delete_excludes("asdf"))