def test_data_state_readonly(self):
     data_state_db.set_readonly(self.session)
     ds = data_state_db.get_data_state(self.session)
     self.assertTrue(ds.readonly)
     # TODO(Joe) - creating tasks should fail here. Implement
     # with further task_db changes coming in data sync
     data_state_db.set_readwrite(self.session)
     ds = data_state_db.get_data_state(self.session)
     self.assertTrue(not ds.readonly)
Пример #2
0
 def test_data_state_readonly(self):
     data_state_db.set_readonly(self.session)
     ds = data_state_db.get_data_state(self.session)
     self.assertTrue(ds.readonly)
     # TODO(Joe) - creating tasks should fail here. Implement
     # with further task_db changes coming in data sync
     data_state_db.set_readwrite(self.session)
     ds = data_state_db.get_data_state(self.session)
     self.assertFalse(ds.readonly)
Пример #3
0
def data_readonly(config, cmd):
    """Sets the task table access state to "read only"

    :param config: contains neutron configuration, like database connection.
    :param cmd: unused, but needed in the function signature by the command
        parser.
    """
    session = get_session(config)
    ds_db.set_readonly(session)
Пример #4
0
def data_readonly(config, cmd):
    """
    Sets the task table access state to "read only"

    :param config: contains neutron configuration, like database connection.
    :param cmd: unused, but needed in the function signature by the command
        parser.
    """
    session = get_session(config)
    ds_db.set_readonly(session)