Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
test more hrest
Browse files Browse the repository at this point in the history
  • Loading branch information
cglewis committed Nov 11, 2013
1 parent 1c262da commit a69326c
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions hemlock/test_hemlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,34 @@ def process_hmongo_connect_client(self):
x = a.get_data(0, client_dict, c_server, h_server, "asdf", 0)
return x, error

def process_hrest_connect_client(self):
"""
Tests hrest connect_client.
:return: returns any data and a list of any errors
"""
error = []
a = Hemlock_Base()
a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample"
client_dict, server_dict = a.get_creds(0, "hemlock/clients/rest_creds_sample")
h_server = a.connect_server(0, server_dict, 1)
a = HRest()
a.connect_client(0, client_dict)

def process_hrest_get_data(self):
"""
Tests hrest get_data.
:return: returns any data and a list of any errors
"""
error = []
a = Hemlock_Base()
a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample"
client_dict, server_dict = a.get_creds(0, "hemlock/clients/rest_creds_sample")
h_server = a.connect_server(0, server_dict, 1)
a = HRest()
a.get_data(0, client_dict, "bogus", h_server, "asdf", 0)

def process_hemlock_base_update_hemlock(self):
"""
Tests hemlock_base update_hemlock.
Expand Down Expand Up @@ -2119,6 +2147,20 @@ def test_process_hmongo_connect_client(self):
x, error = self.process_hmongo_connect_client()
for err in error: assert err == 0

def test_process_hrest_connect_client(self):
"""
Calls the test function for the hrest connect_client.
"""
with pytest.raises(SystemExit):
x, error = self.process_hrest_connect_client()

def test_process_hrest_get_data(self):
"""
Calls the test function for the hrest get_data.
"""
with pytest.raises(SystemExit):
x, error = self.process_hrest_get_data()

def test_process_hemlock_base_update_hemlock(self):
"""
Calls the test function for the hemlock_base update_hemlock.
Expand Down

0 comments on commit a69326c

Please sign in to comment.