Esempio n. 1
0
 def test_from_str(self):
     s = 'name=a;doc=b;unit=mm;components=[x,y,z];sep= - ;category=category_1;tags=[tag_1,tag_2];identifier=test_var'
     dct = {
         'name': 'a',
         'doc': 'b',
         'unit': 'mm',
         'components': ['x', 'y', 'z'],
         'sep': ' - ',
         'category': 'category_1',
         'tags': ['tag_1', 'tag_2'],
         'identifier': 'test_var'
     }
     v = Variable.from_str(s)
     v_check = Variable(**dct)
     self.assertEqual(v.to_str(), v_check.to_str())
Esempio n. 2
0
 def test_to_str(self):
     dct = {
         'name': 'a',
         'doc': 'b',
         'unit': 'mm',
         'components': ['x', 'y', 'z'],
         'sep': ' - ',
         'category': 'category_1',
         'tags': ['tag_1', 'tag_2'],
         'identifier': 'test_var'
     }
     v = Variable(**dct)
     s = v.to_str()
     expected = 'name=a;doc=b;unit=mm;components=[x,y,z];sep= - ;category=category_1;tags=[tag_1,tag_2];identifier=test_var'
     self.assertEqual(s, expected)