Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ repos:
- id: flake8
args: ['--config=.flake8']
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 22.6.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to update to the latest version due to a bug with Python on M1.

hooks:
- id: black
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
pre-commit >= 2.10.0
pre-commit >= 2.19.0
8 changes: 4 additions & 4 deletions test/test_projects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_retrieve_project_language(self):
"""
project_id = "pro_test_2b67b11a030b66e0a6dd61a56b49079a"
project = self.api.retrieve_project(id=project_id, accept_language="fr").data
self.assertIn("Projet", project.name) # French
self.assertIn("Démo", project.name) # French

def test_retrieve_projects(self):
"""Test case for retrieve_projects
Expand All @@ -87,13 +87,13 @@ def test_retrieve_projects(self):
self.assertEqual(project.production, False)
self.assertGreater(project.average_price_per_tonne_cents_usd, 0)
self.assertGreater(project.remaining_mass_g, 0)
self.assertEqual(project.standard, None)
self.assertIsInstance(project.standard, object)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shows that having good demo data is a good idea.

self.assertIsInstance(project.name, str)
self.assertTrue(project.description)
self.assertIsInstance(project.country, str)
self.assertIsInstance(project.type, str)
self.assertIsInstance(project.developer, str)
self.assertTrue(isinstance(project.photos, list))
self.assertIsInstance(project.photos, list)

def test_retrieve_biomass_projects(self):
"""Test case for retrieve_projects with a type filter
Expand Down Expand Up @@ -141,7 +141,7 @@ def test_retrieve_projects_language(self):
projects = self.api.retrieve_projects(accept_language="fr").data

for project in projects:
self.assertIn("Projet", project.name) # French
self.assertIn("Démo", project.name) # French


if __name__ == "__main__":
Expand Down