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

Add some tests for Docker repository C. #53

Closed
wants to merge 1 commit into from

Conversation

bowlofeggs
Copy link

(The RUD will be added later…)

@@ -0,0 +1,88 @@
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: can I get an encoding declaration, a change in format and unicode literals?

# coding=utf-8
"""Test CRUD for Docker repositories.

This module contains tests for creating Docker repositories. It is intended to
also contain read, update, and delete tests.

"""
from __future__ import unicode_literals

# other imports here

(#24 is a related low-priority issue.)

Copy link
Author

Choose a reason for hiding this comment

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

Sure thing, this is fixed now.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@Ichimonji10
Copy link
Contributor

FYI, none of these modules will be included in the documentation right now. You can prove that to yourself by executing make docs-html and exploring what's generated. Adding in new documentation stubs is a grungy manual job right now - #18 describes an improvement on that front. If you want to add in the necessary *.rst files yourself, that's great. But don't get stressed out about it. I can easily add in the files myself when merging.

Do you have any test output? I can run these tests against my local VMs, but it's handy to have some basic evidence that tests are working before I review the tests. 😄 (For the record, I create a test matrix like this before merging any significant PR.) Again, don't stress out about providing a full test matrix. I can easily do that.

@Ichimonji10
Copy link
Contributor

This PR looks fine. If you can take a few minutes to address my nitpicks, I'll happily add in the documentation stubs, run a test matrix and merge this.

(The RUD will be added later…)
@bowlofeggs
Copy link
Author

I need to go fix some Docker bugs that are "on fire" so I don't have time to do the docs yet. Also, that link to the test matrix is a 404, but will you accept this statement as evidence?

I ran these tests and they passed:

(pulp-smash)[vagrant@dev pulp-smash]$ psmash
flake8 . --ignore D203
pylint --reports=n --disable=I docs/conf.py tests setup.py \
    pulp_smash/__init__.py \
    pulp_smash/__main__.py \
    pulp_smash/config.py \
    pulp_smash/constants.py \
    pulp_smash/utils.py
No config file found, using default configuration
pylint --reports=n --disable=I,duplicate-code pulp_smash/tests/
No config file found, using default configuration
.......F...s.s.......ssss..............................................................s........
======================================================================
FAIL: test_body (tests.platform.api_v2.test_content_applicability.SuccessTestCase) [1]
Assert that the responses are JSON and appear to be call reports.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/devel/pulp-smash/pulp_smash/tests/platform/api_v2/test_content_applicability.py", line 51, in test_body
    CALL_REPORT_KEYS,
AssertionError: Items in the first set but not the second:
u'group_id'
u'_href'
Items in the second set but not the first:
u'spawned_tasks'
u'result'
u'error'

======================================================================
FAIL: test_body (tests.platform.api_v2.test_login.LoginFailureTestCase)
Assert that the response is valid JSON and has correct keys.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/devel/pulp-smash/pulp_smash/tests/platform/api_v2/test_login.py", line 56, in test_body
    self.assertEqual(frozenset(self.response.json().keys()), ERROR_KEYS)
AssertionError: Items in the first set but not the second:
u'http_request_method'
u'auth_error_code'

======================================================================
FAIL: test_exception_keys_json (tests.platform.api_v2.test_repository.CreateFailureTestCase) (body={u'id': None})
Assert the JSON body returned contains the correct keys.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/devel/pulp-smash/pulp_smash/tests/platform/api_v2/test_repository.py", line 147, in test_exception_keys_json
    ERROR_KEYS,
AssertionError: Items in the first set but not the second:
u'http_request_method'
u'property_names'

======================================================================
FAIL: test_exception_keys_json (tests.platform.api_v2.test_repository.CreateFailureTestCase) (body=[u'Incorrect data type'])
Assert the JSON body returned contains the correct keys.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/devel/pulp-smash/pulp_smash/tests/platform/api_v2/test_repository.py", line 147, in test_exception_keys_json
    ERROR_KEYS,
AssertionError: Items in the first set but not the second:
u'http_request_method'
Items in the second set but not the first:
u'error'

======================================================================
FAIL: test_exception_keys_json (tests.platform.api_v2.test_repository.CreateFailureTestCase) (body={u'missing_required_keys': u'id'})
Assert the JSON body returned contains the correct keys.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/devel/pulp-smash/pulp_smash/tests/platform/api_v2/test_repository.py", line 147, in test_exception_keys_json
    ERROR_KEYS,
AssertionError: Items in the first set but not the second:
u'http_request_method'
u'property_names'

======================================================================
FAIL: test_exception_keys_json (tests.platform.api_v2.test_repository.CreateFailureTestCase) (body={u'id': u'739ac2b7-5221-4649-9cd8-be83757b9b43'})
Assert the JSON body returned contains the correct keys.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/devel/pulp-smash/pulp_smash/tests/platform/api_v2/test_repository.py", line 147, in test_exception_keys_json
    ERROR_KEYS,
AssertionError: Items in the first set but not the second:
u'http_request_method'
u'resource_id'

----------------------------------------------------------------------
Ran 98 tests in 72.971s

FAILED (failures=6, skipped=7)

The failures happened before I wrote any code, so it seems that there is a pre-existing problem.

@Ichimonji10
Copy link
Contributor

The failures happened before I wrote any code, so it seems that there is a pre-existing problem.

Fixes are available on the master branch.

@Ichimonji10 Ichimonji10 self-assigned this Dec 17, 2015
@Ichimonji10
Copy link
Contributor

Merged as 129f682. Thank you!

@bowlofeggs bowlofeggs deleted the docker_crud branch February 22, 2016 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants