Bugfix, cleanup and optimisation

This commit is contained in:
Eriks Karls 2019-09-05 15:01:54 +03:00
parent 60543e02c8
commit 896b1b2432
3 changed files with 3 additions and 5 deletions

View File

@ -93,7 +93,7 @@ class Citizen(classes.CitizenAPI):
def __dict__(self):
ret = {}
for key in dir(self):
if not key.startswith('_'):
if not key.startswith('_') and not callable(getattr(self, key)):
ret[key] = getattr(self, key)
ret.pop('reporter', None)
ret.pop('stop_threads', None)

View File

@ -695,7 +695,8 @@ Class for unifying eRepublik known endpoints and their required/optional paramet
data.update({"sell": "sell"})
else:
data.update({"dissolve": factory})
return self.post("{}/economy/sell-company/{}".format(self.url, factory), data=data, headers={"Referer": url})
return self.post("{}/economy/sell-company/{}".format(self.url, factory),
data=data, headers={"Referer": self.url})
def _post_economy_train(self, tg_ids: List[int]) -> Response:
data: Dict[str, Union[int, str]] = {}

View File

@ -17,9 +17,6 @@ class TestErepublik(unittest.TestCase):
self.citizen = Citizen("email", "password", False)
self.citizen.config.interactive = False
def test_000_something(self):
"""Test something."""
def test_should_do_levelup(self):
self.citizen.energy.recovered = 1900
self.citizen.energy.recoverable = 2940