diff --git a/tests/samples/output/common_usage_header b/tests/samples/output/common_usage_header new file mode 100644 index 0000000..5dbd60e --- /dev/null +++ b/tests/samples/output/common_usage_header @@ -0,0 +1,12 @@ +usage: wakatime [-h] [--entity FILE] [--key KEY] [--write] [--plugin PLUGIN] + [--time time] [--lineno LINENO] [--cursorpos CURSORPOS] + [--entity-type ENTITY_TYPE] [--category CATEGORY] + [--proxy PROXY] [--no-ssl-verify] [--project PROJECT] + [--alternate-project ALTERNATE_PROJECT] [--language LANGUAGE] + [--local-file FILE] [--hostname HOSTNAME] [--disable-offline] + [--hide-file-names] [--hide-project-names] [--exclude EXCLUDE] + [--exclude-unknown-project] [--include INCLUDE] + [--include-only-with-project-file] [--extra-heartbeats] + [--log-file LOG_FILE] [--api-url API_URL] [--timeout TIMEOUT] + [--sync-offline-activity SYNC_OFFLINE_ACTIVITY] + [--config CONFIG] [--verbose] [--version] diff --git a/tests/samples/output/configs_test_config_file_not_passed_in_command_line_args b/tests/samples/output/configs_test_config_file_not_passed_in_command_line_args index 1801fac..137d370 100644 --- a/tests/samples/output/configs_test_config_file_not_passed_in_command_line_args +++ b/tests/samples/output/configs_test_config_file_not_passed_in_command_line_args @@ -1,13 +1 @@ -usage: wakatime [-h] [--entity FILE] [--key KEY] [--write] [--plugin PLUGIN] - [--time time] [--lineno LINENO] [--cursorpos CURSORPOS] - [--entity-type ENTITY_TYPE] [--category CATEGORY] - [--proxy PROXY] [--no-ssl-verify] [--project PROJECT] - [--alternate-project ALTERNATE_PROJECT] [--language LANGUAGE] - [--local-file FILE] [--hostname HOSTNAME] [--disable-offline] - [--hide-file-names] [--hide-project-names] [--exclude EXCLUDE] - [--exclude-unknown-project] [--include INCLUDE] - [--include-only-with-project-file] [--extra-heartbeats] - [--log-file LOG_FILE] [--api-url API_URL] [--timeout TIMEOUT] - [--sync-offline-activity SYNC_OFFLINE_ACTIVITY] - [--config CONFIG] [--verbose] [--version] wakatime: error: Missing api key. Find your api key from wakatime.com/settings/api-key. diff --git a/tests/samples/output/configs_test_missing_config_file b/tests/samples/output/configs_test_missing_config_file index 1801fac..137d370 100644 --- a/tests/samples/output/configs_test_missing_config_file +++ b/tests/samples/output/configs_test_missing_config_file @@ -1,13 +1 @@ -usage: wakatime [-h] [--entity FILE] [--key KEY] [--write] [--plugin PLUGIN] - [--time time] [--lineno LINENO] [--cursorpos CURSORPOS] - [--entity-type ENTITY_TYPE] [--category CATEGORY] - [--proxy PROXY] [--no-ssl-verify] [--project PROJECT] - [--alternate-project ALTERNATE_PROJECT] [--language LANGUAGE] - [--local-file FILE] [--hostname HOSTNAME] [--disable-offline] - [--hide-file-names] [--hide-project-names] [--exclude EXCLUDE] - [--exclude-unknown-project] [--include INCLUDE] - [--include-only-with-project-file] [--extra-heartbeats] - [--log-file LOG_FILE] [--api-url API_URL] [--timeout TIMEOUT] - [--sync-offline-activity SYNC_OFFLINE_ACTIVITY] - [--config CONFIG] [--verbose] [--version] wakatime: error: Missing api key. Find your api key from wakatime.com/settings/api-key. diff --git a/tests/samples/output/main_test_timeout_passed_via_command_line b/tests/samples/output/main_test_timeout_passed_via_command_line index f4ec1b9..307c151 100644 --- a/tests/samples/output/main_test_timeout_passed_via_command_line +++ b/tests/samples/output/main_test_timeout_passed_via_command_line @@ -1,13 +1 @@ -usage: wakatime [-h] [--entity FILE] [--key KEY] [--write] [--plugin PLUGIN] - [--time time] [--lineno LINENO] [--cursorpos CURSORPOS] - [--entity-type ENTITY_TYPE] [--category CATEGORY] - [--proxy PROXY] [--no-ssl-verify] [--project PROJECT] - [--alternate-project ALTERNATE_PROJECT] [--language LANGUAGE] - [--local-file FILE] [--hostname HOSTNAME] [--disable-offline] - [--hide-file-names] [--hide-project-names] [--exclude EXCLUDE] - [--exclude-unknown-project] [--include INCLUDE] - [--include-only-with-project-file] [--extra-heartbeats] - [--log-file LOG_FILE] [--api-url API_URL] [--timeout TIMEOUT] - [--sync-offline-activity SYNC_OFFLINE_ACTIVITY] - [--config CONFIG] [--verbose] [--version] wakatime: error: argument --timeout: invalid int value: 'abc' diff --git a/tests/samples/output/test_help_contents b/tests/samples/output/test_help_contents index 84fbc68..c2eea17 100644 --- a/tests/samples/output/test_help_contents +++ b/tests/samples/output/test_help_contents @@ -1,15 +1,3 @@ -usage: wakatime [-h] [--entity FILE] [--key KEY] [--write] [--plugin PLUGIN] - [--time time] [--lineno LINENO] [--cursorpos CURSORPOS] - [--entity-type ENTITY_TYPE] [--category CATEGORY] - [--proxy PROXY] [--no-ssl-verify] [--project PROJECT] - [--alternate-project ALTERNATE_PROJECT] [--language LANGUAGE] - [--local-file FILE] [--hostname HOSTNAME] [--disable-offline] - [--hide-file-names] [--hide-project-names] [--exclude EXCLUDE] - [--exclude-unknown-project] [--include INCLUDE] - [--include-only-with-project-file] [--extra-heartbeats] - [--log-file LOG_FILE] [--api-url API_URL] [--timeout TIMEOUT] - [--sync-offline-activity SYNC_OFFLINE_ACTIVITY] - [--config CONFIG] [--verbose] [--version] Common interface for the WakaTime api. diff --git a/tests/test_arguments.py b/tests/test_arguments.py index 3df6226..fd641e2 100644 --- a/tests/test_arguments.py +++ b/tests/test_arguments.py @@ -44,7 +44,8 @@ class ArgumentsTestCase(TestCase): execute(args) self.assertEquals(int(str(e.exception)), 0) - expected_stdout = open('tests/samples/output/test_help_contents').read() + expected_stdout = open('tests/samples/output/common_usage_header').read() + expected_stdout += open('tests/samples/output/test_help_contents').read() self.assertEquals(sys.stdout.getvalue(), expected_stdout) self.assertEquals(sys.stderr.getvalue(), '') self.assertNothingLogged(logs) @@ -172,7 +173,8 @@ class ArgumentsTestCase(TestCase): self.assertNothingLogged(logs) self.assertEquals(int(str(e.exception)), 2) self.assertEquals(sys.stdout.getvalue(), '') - expected_stderr = open('tests/samples/output/main_test_timeout_passed_via_command_line').read() + expected_stderr = open('tests/samples/output/common_usage_header').read() + expected_stderr += open('tests/samples/output/main_test_timeout_passed_via_command_line').read() self.assertEquals(sys.stderr.getvalue(), expected_stderr) self.patched['wakatime.offlinequeue.Queue.push'].assert_not_called() diff --git a/tests/test_configs.py b/tests/test_configs.py index 520c326..8b8a45f 100644 --- a/tests/test_configs.py +++ b/tests/test_configs.py @@ -55,7 +55,8 @@ class ConfigsTestCase(TestCase): self.assertEquals(int(str(e.exception)), AUTH_ERROR) expected_stdout = u('') - expected_stderr = open('tests/samples/output/configs_test_config_file_not_passed_in_command_line_args').read() + expected_stderr = open('tests/samples/output/common_usage_header').read() + expected_stderr += open('tests/samples/output/configs_test_config_file_not_passed_in_command_line_args').read() self.assertEquals(sys.stdout.getvalue(), expected_stdout) self.assertEquals(sys.stderr.getvalue(), expected_stderr) self.patched['wakatime.session_cache.SessionCache.get'].assert_not_called() @@ -107,7 +108,8 @@ class ConfigsTestCase(TestCase): self.assertEquals(int(str(e.exception)), AUTH_ERROR) expected_stdout = u('') - expected_stderr = open('tests/samples/output/configs_test_missing_config_file').read() + expected_stderr = open('tests/samples/output/common_usage_header').read() + expected_stderr += open('tests/samples/output/configs_test_missing_config_file').read() self.assertEquals(sys.stdout.getvalue(), expected_stdout) self.assertEquals(sys.stderr.getvalue(), expected_stderr)