Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

[VDCA-584] Added Org system tests #258

Merged
merged 6 commits into from Jun 26, 2018
Merged

Conversation

rocknes
Copy link
Contributor

@rocknes rocknes commented Jun 25, 2018

  • Added Org system tests.
  • Added proper license header to all the system test files.
  • Standardized Client.get_org_by_name() and Client.get_org_list() method's output format
  • Handled fallout of the changes to Client.get_org_by_name() and Client.get_org_list()'s output.
  • Fixed a bug in Utils.get_admin_href() and Utils.get_admin_extension_href() to make them idempotent.

This change is Reviewable

@rocknes rocknes requested a review from hodgesrm June 25, 2018 17:44
@hodgesrm
Copy link

Reviewed 9 of 9 files at r1.
Review status: all files reviewed, 4 unresolved discussions (waiting on @rocknes)


pyvcloud/vcd/client.py, line 1137 at r1 (raw file):

        """
        # Avoid using get_org_list() to fetch all orgs and then filter the
        # reuslt by organization name, since get_org_list() will fetch details

reuslt -> result


pyvcloud/vcd/utils.py, line 607 at r1 (raw file):

def get_admin_href(href):
    """Returns admin version of a given vCD url.

Should note that if handed an admin URL you will return it without change (to match case logic below).


system_tests/org_tests.py, line 101 at r1 (raw file):

        except EntityNotFoundException as e:
            return
        self.fail('Should fail with EntityNotFoundException while fetching'

This code looks unreachable. You should have an exception other than EntityNotFoundException which means Python will unwind the stack before hitting this line.


system_tests/org_tests.py, line 125 at r1 (raw file):

        """Test the  method System.delete_org().

        Invoke delete operation on an enabled organization.

Nit: Had to read this twice to be clear that the operation would fail because the Org is enabled and force=False. Should clarify in comment.


Comments from Reviewable

@rocknes
Copy link
Contributor Author

rocknes commented Jun 26, 2018

Review status: all files reviewed, 4 unresolved discussions (waiting on @rocknes)


system_tests/org_tests.py, line 101 at r1 (raw file):

Previously, hodgesrm (Robert Hodges) wrote…

This code looks unreachable. You should have an exception other than EntityNotFoundException which means Python will unwind the stack before hitting this line.

Agreed, will remove this.


Comments from Reviewable

@rocknes
Copy link
Contributor Author

rocknes commented Jun 26, 2018

Review status: 6 of 9 files reviewed, 4 unresolved discussions (waiting on @hodgesrm and @rocknes)


pyvcloud/vcd/client.py, line 1137 at r1 (raw file):

Previously, hodgesrm (Robert Hodges) wrote…

reuslt -> result

Fixed


pyvcloud/vcd/utils.py, line 607 at r1 (raw file):

Previously, hodgesrm (Robert Hodges) wrote…

Should note that if handed an admin URL you will return it without change (to match case logic below).

Added extra doc sting explaining the behavior


system_tests/org_tests.py, line 125 at r1 (raw file):

Previously, hodgesrm (Robert Hodges) wrote…

Nit: Had to read this twice to be clear that the operation would fail because the Org is enabled and force=False. Should clarify in comment.

Added additional doc-string to clarify the test case.


Comments from Reviewable

@hodgesrm
Copy link

:lgtm: Thanks for the changes. Looks great.


Reviewed 3 of 3 files at r2.
Review status: :shipit: complete! all files reviewed, all discussions resolved


Comments from Reviewable

@rocknes rocknes merged commit ea2a2d5 into vmware-archive:master Jun 26, 2018
@rocknes rocknes deleted the org_tests branch June 26, 2018 23:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants