Exemplo n.º 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)
Exemplo n.º 2
0
def test_is_sequence_like():
    assert is_sequence_like([1, 3, 4])
    assert not is_sequence_like(42)
Exemplo n.º 3
0
def test_is_sequence_like():
    assert is_sequence_like([1, 3, 4])
    assert not is_sequence_like(42)