class SortKeyModel(Model): id = String() name = String()
class FakeModel(Model): test = String() test2 = String()
def test_set(self): """it adds the SET attribute""" expression = EqualityExpression('=', String(), 'test') self.request.update_expression = Mock() self.request.set(expression) self.request.update_expression.assert_called_with('SET', expression)
class FakeModel(Model): __tablename__ = 'test' test1 = String() test2 = Number()
class TestModel(Model): test = String()
def setUp(self): super(TestString, self).setUp() self.dt = String(column_name="test")
def setUp(self): self.dt = String(column_name="testcol")
class TestModel(Model): __tablename__ = "test" test1 = String() test2 = String()
def setUp(self): super(TestSet, self).setUp() self.dt = Set(String(), column_name="test")
def test_index(self): """it returns a new instance of the datatype passed with the column_name it sets _index on the returned datatype instance""" res = self.dt.index(0, String()) assert isinstance(res, String) assert res._index == 0
class TestModel(Model): __tablename__ = 'test' _id = String() test = String()
def setUp(self): self.dt = String() self.translator = BaseDatatypeTranslator(self.dt) self.translator.condition_type = 'S' self.decorator = SetTranslator(self.translator)
def setUp(self): self.dt = String() self.translator = BaseDatatypeTranslator(self.dt)
def setUp(self): self.dt = String() self.translator = StringTranslator(self.dt)