Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ctuning/ck-crowdnode
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Mar 7, 2017
2 parents 85a194e + f9dd6dc commit e4251ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/ck-crowdnode-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,9 @@ void processShell(int sock, cJSON* commandJSON, char *baseDir) {
void processState(int sock, const char *baseDir) {
cJSON *resultJSON = cJSON_CreateObject();
cJSON_AddItemToObject(resultJSON, "return", cJSON_CreateString("0"));
cJSON_AddItemToObject(resultJSON, JSON_CONFIG_PARAM_PATH_TO_FILES, cJSON_CreateString(strdup(baseDir)));
cJSON *cfgJSON = cJSON_CreateObject();
cJSON_AddItemToObject(cfgJSON, JSON_CONFIG_PARAM_PATH_TO_FILES, cJSON_CreateString(strdup(baseDir)));
cJSON_AddItemToObject(resultJSON, "cfg", cfgJSON);
sendJson(sock, resultJSON);
cJSON_Delete(resultJSON);
}
Expand Down
5 changes: 3 additions & 2 deletions tests/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ class TestPushPull(unittest.TestCase):

def test_state(self):
r = access_test_repo({'action': 'state'})
self.assertIn('path_to_files', r)
self.assertEqual(files_dir, r['path_to_files'])
cfg_ = r['cfg']
self.assertIn('path_to_files', cfg_)
self.assertEqual(files_dir, cfg_['path_to_files'])
self.assertIn('return', r)
self.assertEqual(0, r['return'])

0 comments on commit e4251ea

Please sign in to comment.