Ejemplo n.º 1
0
 def test__make_ids(self):
     """Test whether regex is correctly generating expressions."""
     metadata = {'subtype': 'string', 'regex': '[a-d]'}
     keys = Table._make_ids(metadata, 3)
     assert (keys == pd.Series(['a', 'b', 'c'])).all()
Ejemplo n.º 2
0
 def test__make_ids_fail(self):
     """Test if regex fails with more requested ids than available unique values."""
     metadata = {'subtype': 'string', 'regex': '[a-d]'}
     with pytest.raises(ValueError):
         Table._make_ids(metadata, 20)