Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring and updating of unit tests #87

Closed
fleimgruber opened this issue Nov 17, 2020 · 3 comments
Closed

Refactoring and updating of unit tests #87

fleimgruber opened this issue Nov 17, 2020 · 3 comments

Comments

@fleimgruber
Copy link
Contributor

Proposal to move unit tests to the conventional top level tests directory. For a first draft, please see fleimgruber@4fe0fb7. I tried to separate into tests related to domains and clients. Is the test code still relevant or does it need to be adapted due to internal API changes? E.g. for test_domains I get 9 tests passing and one failing like this (because of binary string vs. str):

FAILED          [ 10%]
tests\test_clients.py:23 (EntsoeRawClientTest.test_basic_queries)
self = <tests.test_clients.EntsoeRawClientTest testMethod=test_basic_queries>

    def test_basic_queries(self):
        queries = [
            self.client.query_day_ahead_prices,
            self.client.query_load,
            self.client.query_wind_and_solar_forecast,
            self.client.query_load_forecast,
            self.client.query_generation,
            self.client.query_generation_forecast,
            self.client.query_installed_generation_capacity,
            self.client.query_imbalance_prices
        ]
        for query in queries:
            text = query(country_code=self.country_code, start=self.start,
                         end=self.end)
>           self.assertIsInstance(text, str)
E           AssertionError: b'PK\x03\x04\x14\x00\x08\x08\x08\x00...' is not an instance of <class 'str'>

test_clients.py:38: AssertionError
@fboerman
Copy link
Collaborator

hi @fleimgruber this seems like a good idea. Could you provide a pull request for it?

@fleimgruber
Copy link
Contributor Author

@fboerman please see #131.

@fboerman
Copy link
Collaborator

hi @fleimgruber thank you lets move the discussion to there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants