Skip to content

Commit

Permalink
Domain: additional test for getitem
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Aug 28, 2020
1 parent 17a55ea commit b445bbf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Orange/tests/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,21 @@ def test_domain_conversion_sparsity(self):
self.assertTrue(conversion.sparse_Y)
self.assertFalse(conversion.sparse_metas)

def test_get_item_similar_vars(self):
a = DiscreteVariable("Cluster", values=["c"])
var1 = a.renamed("Cluster x")
var2 = DiscreteVariable("Cluster", values=["a", "b"])

domain = Domain(
[],
metas=[var1, var2]
)
self.assertDictEqual(
{-1: -1, -2: -2, id(var1): -1, id(var2): -2, var1.name: -1, var2.name: -2},
domain._indices
)
self.assertIs(domain[domain.metas[0]], domain.metas[0])


class TestDomainFilter(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit b445bbf

Please sign in to comment.