コード例 #1
0
 def test_unmarshal_val_not_in_choices_gives_sam_val(self):
     # TODO: Test that logging is done as well
     c = ChoicesAttribute(unicode, (SUMMARY, ),
                          choices={
                              1: "one",
                              2: "two"
                          })
     self.assertEqual(c.unmarshal(0), 0)
     self.assertEqual(c.unmarshal(None), None)
コード例 #2
0
 def test_unmarshal_data(self):
     c = ChoicesAttribute(unicode, (SUMMARY, ),
                          choices={
                              1: "one",
                              2: "two"
                          })
     self.assertEqual(c.unmarshal(2), "two")
     self.assertEqual(c.unmarshal(1), "one")
コード例 #3
0
ファイル: test_attributes.py プロジェクト: davew/stravalib
 def test_unmarshal_val_not_in_choices_gives_sam_val(self):
     # TODO: Test that logging is done as well
     c = ChoicesAttribute(unicode, (SUMMARY, ), choices={1: "one", 2: "two"})
     self.assertEqual(c.unmarshal(0), 0)
     self.assertEqual(c.unmarshal(None), None)
コード例 #4
0
ファイル: test_attributes.py プロジェクト: davew/stravalib
 def test_unmarshal_data(self):
     c = ChoicesAttribute(unicode, (SUMMARY, ), choices={1: "one", 2: "two"})
     self.assertEqual(c.unmarshal(2), "two")
     self.assertEqual(c.unmarshal(1), "one")