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)
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)
def data_show(config, cmd): """Dumps the contents of the data state table. :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) printer = config.print_stdout data_state = ds_db.get_data_state(session) line = "%-25s : %s" printer(line, "last processed task id", data_state.last_processed_task_id) printer(line, "last updated", data_state.updated_at) printer(line, "active version", data_state.active_version) readonly = "True" if data_state.readonly else "False" printer(line, "read only", readonly)
def data_show(config, cmd): """ Dumps the contents of the data state table. :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) printer = config.print_stdout data_state = ds_db.get_data_state(session) line = "%-25s : %s" printer(line, "last processed task id", data_state.last_processed_task_id) printer(line, "last updated", data_state.updated_at) printer(line, "active version", data_state.active_version) readonly = "True" if data_state.readonly else "False" printer(line, "read only", readonly)
def test_data_show(self): ds = data_state_db.get_data_state(self.session) self.assertTrue(ds.id is not None)
def test_data_show(self): ds = data_state_db.get_data_state(self.session) self.assertIsNotNone(ds.id)