コード例 #1
0
 def test_serialize_behavior(self):
     assert Device.to_python({
         'name': 'Windows',
         'version': '95',
     }).to_json() == {
         'name': 'Windows',
         'version': '95',
     }
コード例 #2
0
 def test_path(self):
     assert Device().get_path() == 'device'
コード例 #3
0
 def test_missing_version(self):
     with pytest.raises(InterfaceValidationError):
         assert Device.to_python({
             'name': 'Windows',
         })
コード例 #4
0
 def test_missing_name(self):
     with pytest.raises(InterfaceValidationError):
         assert Device.to_python({
             'version': '95',
         })