Exemplo n.º 1
0
    def test_init(self):
        variable1 = Variable(clientid='client',
                             userid='user',
                             name='name',
                             value='value')
        self.assertIsNotNone(variable1)
        self.assertEqual(
            "<Variable(id='n/a', clientid='client', userid='user', name='name', value='value')>",
            str(variable1))

        variable2 = Variable(id=1,
                             clientid='client',
                             userid='user',
                             name='name',
                             value='value')
        self.assertIsNotNone(variable2)
        self.assertEqual(
            "<Variable(id='1', clientid='client', userid='user', name='name', value='value')>",
            str(variable2))
Exemplo n.º 2
0
 def add_variables(self, clientid, userid, variables):
     for name, value in variables.items():
         var = Variable(clientid=clientid, userid=userid, name=name, value=value)
         self._storage_engine.session.add(var)
Exemplo n.º 3
0
 def add_variable(self, clientid, userid, name, value):
     var = Variable(clientid=clientid, userid=userid, name=name, value=value)
     self._storage_engine.session.add(var)