10000 fix: str/repr for BackgroundJobItem · tableau/server-client-python@51112f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51112f1

Browse files
committed
fix: str/repr for BackgroundJobItem
1 parent 8b728a5 commit 51112f1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tableauserverclient/models/job_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def __init__(
222222
self._subtitle = subtitle
223223

224224
def __str__(self):
225-
return f"<{self.__class__.name} {self._id} {self._type}>"
225+
return f"<{self.__class__.__qualname__} {self._id} {self._type}>"
226226

227227
def __repr__(self):
228228
return self.__str__() + " { " + ", ".join(" % s: % s" % item for item in vars(self).items()) + "}"

test/test_job.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,11 @@ def test_get_job_datasource_name(self) -> None:
136136
m.get(f"{self.baseurl}/{job_id}", text=response_xml)
137137
job = self.server.jobs.get_by_id(job_id)
138138
self.assertEqual(job.datasource_name, "World Indicators 62E7 ")
139+
140+
def test_background_job_str(self) -> None:
141+
job = TSC.BackgroundJobItem(
142+
"ee8c6e70-43b6-11e6-af4f-f7b0d8e20760", datetime.now(), 1, "extractRefresh", "Failed"
143+
)
144+
assert not str(job).startswith("<<property")
145+
assert not repr(job).startswith("<<property")
146+
assert "BackgroundJobItem" in str(job)

0 commit comments

Comments
 (0)
0