def setUp(self): self.item = fs.Item(test_path)
def test_parent_both_present(self): attn1 = fs.AttentionItems(parent=fs.Item(('parent', 'one'))) attn2 = fs.AttentionItems(parent=fs.Item(('parent', 'two'))) self.assertEqual( attn1.extended(attn2).parent, fs.Item(('parent', 'two')))
def test_non_item(self): self.assertNotEqual(fs.Item(test_path), test_path)
def test_different_paths(self): self.assertNotEqual(fs.Item(test_path), fs.Item(('a', 'b')))
def test_parent_one_missing(self): attn1 = fs.AttentionItems(parent=fs.Item(('parent', ))) attn2 = fs.AttentionItems() self.assertEqual(attn1.extended(attn2).parent, fs.Item(('parent', ))) self.assertEqual(attn2.extended(attn1).parent, fs.Item(('parent', )))
def test_items_union(self): attn1 = fs.AttentionItems((fs.Item(('one', )), fs.Item(('two', )))) attn2 = fs.AttentionItems((fs.Item(('two', )), fs.Item(('three', )))) self.assertCountEqual( attn1.extended(attn2).items, (fs.Item(('one', )), fs.Item( ('two', )), fs.Item(('three', ))))
def test_parent(self): self.assertEqual(self.attn.parent, fs.Item(('parent', )))
def test_items(self): self.assertEqual(self.attn.items, (fs.Item( ('a', 'one')), fs.Item(('a', 'two'))))
def setUp(self): self.attn = fs.AttentionItems((fs.Item( ('a', 'one')), fs.Item(('a', 'two'))), fs.Item(('parent', )))
def test_equal(self): self.assertEqual(fs.Item(test_path), fs.Item(test_path))