def testAddGlobalSkipAsItems(self): expected_skips = ['1', '2', '3'] backpy.add_global_skip(backpy.CONFIG_FILE, expected_skips) actual_skips = get_config_key(backpy.CONFIG_FILE, SKIP_KEY) self.assertCountEqual([','.join(expected_skips)], actual_skips)
def testAppendGlobalSkip(self): expected_skips = ['one,two,three'] backpy.add_global_skip(backpy.CONFIG_FILE, ['one,two']) backpy.add_global_skip(backpy.CONFIG_FILE, ['two,three']) actual_skips = get_config_key(backpy.CONFIG_FILE, SKIP_KEY) self.assertCountEqual(expected_skips, actual_skips)
def testAddGlobalSkipWithWildcards(self): expected_skips = ['*.abc,*.def'] backpy.add_global_skip(backpy.CONFIG_FILE, expected_skips) actual_skips = get_config_key(backpy.CONFIG_FILE, SKIP_KEY) self.assertCountEqual(expected_skips, actual_skips)
def testAddGlobalSkipAsString(self): expected_skips = ['1,2,3'] backpy.add_global_skip(backpy.CONFIG_FILE, expected_skips) actual_skips = get_config_key(backpy.CONFIG_FILE, SKIP_KEY) self.assertCountEqual(expected_skips, actual_skips)
def testRemoveGlobalSkip(self): added_skips = ['1,2,3,4'] expected_skips = ['1,3,4'] backpy.add_global_skip(backpy.CONFIG_FILE, added_skips) backpy.delete_global_skip(backpy.CONFIG_FILE, ['2']) actual_skips = get_config_key(backpy.CONFIG_FILE, SKIP_KEY) self.assertCountEqual(expected_skips, actual_skips)
def testGlobalSkips(self): # create fresh index with exclusions initial_rules = ['a', 'b', 'c'] added_rules = ['d,e'] expected_rules = ['a', 'b', 'c', 'd', 'e'] backpy.add_global_skip(backpy.CONFIG_FILE, added_rules) index = backpy.FileIndex(self.src_root, exclusion_rules=initial_rules) actual_rules = index.skips() self.assertCountEqual(expected_rules, actual_rules)
def add_global_skips(self, skips): backpy.add_global_skip(backpy.CONFIG_FILE, skips)