Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 0adf2a9

Browse files
committed
Add 'Created' column to projects list command
1 parent ef80f07 commit 0adf2a9

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

paperspace/commands/projects.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ def _log_projects_list(self, data):
4646

4747
@staticmethod
4848
def _make_table(projects):
49-
data = [("ID", "Name", "Repository")]
49+
data = [("ID", "Name", "Repository", "Created")]
5050
for project in projects:
5151
id_ = project.get("handle")
5252
name = project.get("name")
5353
repo_url = project.get("repoUrl")
54-
data.append((id_, name, repo_url))
54+
created = project.get("dtCreated")
55+
data.append((id_, name, repo_url, created))
5556

5657
ascii_table = terminaltables.AsciiTable(data)
5758
table_string = ascii_table.table

tests/functional/test_projects.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class TestListProjects(object):
1414
# TODO: change to `REQUEST_JSON = None` or whatever works when PS_API is fixed
1515
REQUEST_JSON = {'teamId': 666}
1616
EXPECTED_RESPONSE_JSON = example_responses.LIST_PROJECTS_RESPONSE
17-
EXPECTED_STDOUT = """+-----------+-------------------+------------+
18-
| ID | Name | Repository |
19-
+-----------+-------------------+------------+
20-
| prq70zy79 | test_project | None |
21-
| prmr22ve0 | keton | None |
22-
| przhbct98 | paperspace-python | None |
23-
+-----------+-------------------+------------+
17+
EXPECTED_STDOUT = """+-----------+-------------------+------------+--------------------------+
18+
| ID | Name | Repository | Created |
19+
+-----------+-------------------+------------+--------------------------+
20+
| prq70zy79 | test_project | None | 2019-03-18T13:24:46.666Z |
21+
| prmr22ve0 | keton | None | 2019-03-25T14:50:43.202Z |
22+
| przhbct98 | paperspace-python | None | 2019-04-04T15:12:34.229Z |
23+
+-----------+-------------------+------------+--------------------------+
2424
"""
2525

2626
BASIC_COMMAND_WITH_API_KEY = ["projects", "list", "--apiKey", "some_key"]

0 commit comments

Comments
 (0)