コード例 #1
0
 def test_defualt_one_username(self):
     """
     Runs get-identities with one username, confirms correct id returned
     """
     output = self.run_line("globus get-identities " +
                            get_user_data()["clitester1a"]["username"])
     self.assertEqual(get_user_data()["clitester1a"]["id"] + "\n", output)
コード例 #2
0
ファイル: test_whoami.py プロジェクト: tkuennen/globus-cli
 def test_linked_identities(self):
     """
     Confirms --linked-identities sees cliester1a-linked#globusid.org
     """
     output = self.run_line("globus whoami --linked-identities")
     self.assertIn(get_user_data()["clitester1a"]["username"], output)
     self.assertIn(get_user_data()["clitester1alinked"]["username"], output)
コード例 #3
0
ファイル: test_basics.py プロジェクト: esadr/globus-cli
 def test_auth_call(self):
     """
     Runs get-identities using test auth refresh token to confirm
     test auth refresh token is live and configured correctly
     """
     output = self.run_line("globus get-identities " +
                            get_user_data()["clitester1a"]["username"])
     self.assertIn(get_user_data()["clitester1a"]["id"], output)
コード例 #4
0
 def test_defualt_one_username(self):
     """
     Runs get-identities with one username, confirms correct id returned
     """
     output = self.run_line(
         "globus get-identities " + get_user_data()["clitester1a"]["username"]
     )
     self.assertEqual(get_user_data()["clitester1a"]["id"] + "\n", output)
コード例 #5
0
ファイル: test_basics.py プロジェクト: globus/globus-cli
 def test_auth_call(self):
     """
     Runs get-identities using test auth refresh token to confirm
     test auth refresh token is live and configured correctly
     """
     output = self.run_line(
         "globus get-identities " + get_user_data()["clitester1a"]["username"]
     )
     self.assertIn(get_user_data()["clitester1a"]["id"], output)
コード例 #6
0
ファイル: test_whoami.py プロジェクト: tkuennen/globus-cli
 def test_verbose_linked_identities(self):
     """
     Confirms combining --verbose and --linked-identities has expected
     values present for the whole identity set.
     """
     output = self.run_line("globus whoami --linked-identities -v")
     for field in ["Username", "Name", "Email", "ID"]:
         self.assertIn(field, output)
     for field in ["username", "name", "email", "id"]:
         self.assertIn(get_user_data()["clitester1a"][field], output)
         self.assertIn(get_user_data()["clitester1alinked"][field], output)
コード例 #7
0
ファイル: test_basics.py プロジェクト: esadr/globus-cli
 def test_json_raw_string_output(self):
     """
     Get single-field jmespath output and make sure it's quoted
     """
     output = self.run_line("globus whoami --jmespath name").strip()
     self.assertEquals(
         '"{}"'.format(get_user_data()["clitester1a"]["name"]), output)
コード例 #8
0
 def test_verbose(self):
     """
     Runs get-identities with --verbose, confirms expected fields found
     """
     go_data = get_user_data()["go"]
     output = self.run_line("globus get-identities --verbose " + go_data["id"])
     for key in ["username", "id", "name", "organization", "email"]:
         self.assertIn(go_data[key], output)
コード例 #9
0
ファイル: test_whoami.py プロジェクト: tkuennen/globus-cli
 def test_verbose(self):
     """
     Confirms --verbose includes Name, Email, and ID fields.
     """
     output = self.run_line("globus whoami --verbose")
     for field in ["Username", "Name", "Email", "ID"]:
         self.assertIn(field, output)
     for field in ["username", "name", "email", "id"]:
         self.assertIn(get_user_data()["clitester1a"][field], output)
コード例 #10
0
 def test_json(self):
     """
     Runs get-identities with -F json confirms expected values
     """
     go_data = get_user_data()["go"]
     output = json.loads(
         self.run_line("globus get-identities -F json " + go_data["id"]))
     for key in go_data:
         self.assertIn(go_data[key], output["identities"][0][key])
コード例 #11
0
 def test_verbose(self):
     """
     Runs get-identities with --verbose, confirms expected fields found
     """
     go_data = get_user_data()["go"]
     output = self.run_line("globus get-identities --verbose " +
                            go_data["id"])
     for key in ["username", "id", "name", "organization", "email"]:
         self.assertIn(go_data[key], output)
コード例 #12
0
 def test_json(self):
     """
     Runs get-identities with -F json confirms expected values
     """
     go_data = get_user_data()["go"]
     output = json.loads(
         self.run_line("globus get-identities -F json " + go_data["id"])
     )
     for key in go_data:
         self.assertIn(go_data[key], output["identities"][0][key])
コード例 #13
0
ファイル: test_basics.py プロジェクト: globus/globus-cli
 def test_auth_call_no_auth(self):
     """
     Runs get-identities with config set to be empty,
     confirms No Authentication CLI error.
     """
     output = self.run_line(
         "globus get-identities " + get_user_data()["clitester1a"]["username"],
         config={},
         assert_exit_code=1,
     )
     self.assertIn("No Authentication provided.", output)
コード例 #14
0
ファイル: test_basics.py プロジェクト: esadr/globus-cli
 def test_auth_call_no_auth(self):
     """
     Runs get-identities with config set to be empty,
     confirms No Authentication CLI error.
     """
     output = self.run_line(
         "globus get-identities " +
         get_user_data()["clitester1a"]["username"],
         config={},
         assert_exit_code=1,
     )
     self.assertIn("No Authentication provided.", output)
コード例 #15
0
    def test_default_multiple_inputs(self):
        """
        Runs get-identities with id username, duplicate and invalid inputs
        Confirms order is preserved and all values are as expected
        """
        in_vals = [
            get_user_data()["clitester1a"]["username"],
            get_user_data()["clitester1a"]["id"], "invalid",
            get_user_data()["go"]["username"],
            get_user_data()["go"]["username"]
        ]

        expected = [
            get_user_data()["clitester1a"]["id"],
            get_user_data()["clitester1a"]["username"], "NO_SUCH_IDENTITY",
            get_user_data()["go"]["id"],
            get_user_data()["go"]["id"]
        ]

        output = self.run_line("globus get-identities " + " ".join(in_vals))
        self.assertEqual("\n".join(expected) + "\n", output)
コード例 #16
0
    def test_default_multiple_inputs(self):
        """
        Runs get-identities with id username, duplicate and invalid inputs
        Confirms order is preserved and all values are as expected
        """
        in_vals = [
            get_user_data()["clitester1a"]["username"],
            get_user_data()["clitester1a"]["id"],
            "invalid",
            get_user_data()["go"]["username"],
            get_user_data()["go"]["username"],
        ]

        expected = [
            get_user_data()["clitester1a"]["id"],
            get_user_data()["clitester1a"]["username"],
            "NO_SUCH_IDENTITY",
            get_user_data()["go"]["id"],
            get_user_data()["go"]["id"],
        ]

        output = self.run_line("globus get-identities " + " ".join(in_vals))
        self.assertEqual("\n".join(expected) + "\n", output)
コード例 #17
0
ファイル: test_basics.py プロジェクト: esadr/globus-cli
 def test_whoami(self):
     """
     Runs whoami to confirm test config successfully setup
     """
     output = self.run_line("globus whoami")
     self.assertIn(get_user_data()["clitester1a"]["username"], output)
コード例 #18
0
ファイル: test_basics.py プロジェクト: globus/globus-cli
 def test_json_raw_string_output(self):
     """
     Get single-field jmespath output and make sure it's quoted
     """
     output = self.run_line("globus whoami --jmespath name").strip()
     self.assertEquals('"{}"'.format(get_user_data()["clitester1a"]["name"]), output)
コード例 #19
0
ファイル: test_basics.py プロジェクト: globus/globus-cli
 def test_whoami(self):
     """
     Runs whoami to confirm test config successfully setup
     """
     output = self.run_line("globus whoami")
     self.assertIn(get_user_data()["clitester1a"]["username"], output)