Beispiel #1
0
 def set(self, value):
     """
     Sets the contained value to the given one.
     """
     assert (not is_sequence_like(value)) and (not is_dict_like(value)), 'the value must be an atomic primitive'
     token_index = self._value_token_index()
     self._tokens[token_index] = py2toml.create_primitive_token(value)
Beispiel #2
0
def test_is_dict_like():
    assert is_dict_like({'name': False})
    assert not is_dict_like(42)
    assert not is_dict_like([4, 8, 15])
Beispiel #3
0
def test_is_dict_like():
    assert is_dict_like({'name': False})
    assert not is_dict_like(42)
    assert not is_dict_like([4, 8, 15])