Skip to content

Commit 9ee16aa

Browse files
committed
Fix tests
1 parent d81fff4 commit 9ee16aa

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: unit-tests
1+
name: Unit tests
22

33
on:
44
push:

tests/unit_tests/connections/signin/test_blocking_http.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ def setUp(self):
4343

4444
def test_signin_root(self):
4545
connection = BlockingHttpSurrealConnection(self.url)
46-
outcome = connection.signin(self.vars_params)
47-
self.assertIn("token", outcome) # Check that the response contains a token
46+
response = connection.signin(self.vars_params)
47+
self.assertIsNotNone(response)
48+
_ = self.connection.query("DELETE user;")
49+
_ = self.connection.query("REMOVE TABLE user;")
4850

4951
def test_signin_namespace(self):
5052
connection = BlockingHttpSurrealConnection(self.url)
@@ -53,7 +55,8 @@ def test_signin_namespace(self):
5355
"username": "test",
5456
"password": "test",
5557
}
56-
_ = connection.signin(vars)
58+
response = connection.signin(vars)
59+
self.assertIsNotNone(response)
5760
_ = self.connection.query("DELETE user;")
5861
_ = self.connection.query("REMOVE TABLE user;")
5962

@@ -65,7 +68,8 @@ def test_signin_database(self):
6568
"username": "test",
6669
"password": "test",
6770
}
68-
_ = connection.signin(vars)
71+
response = connection.signin(vars)
72+
self.assertIsNotNone(response)
6973
_ = self.connection.query("DELETE user;")
7074
_ = self.connection.query("REMOVE TABLE user;")
7175

@@ -80,8 +84,8 @@ def test_signin_record(self):
8084
}
8185
}
8286
connection = BlockingHttpSurrealConnection(self.url)
83-
# for below if client is HTTP then persist and attach to all headers
84-
_ = connection.signin(vars)
87+
response = connection.signin(vars)
88+
self.assertIsNotNone(response)
8589

8690
outcome = connection.info()
8791
self.assertEqual(outcome["email"], "test@gmail.com")

tests/unit_tests/connections/signin/test_blocking_ws.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def setUp(self):
4343

4444
def test_signin_root(self):
4545
connection = BlockingWsSurrealConnection(self.url)
46-
_ = connection.signin(self.vars_params)
46+
response = connection.signin(self.vars_params)
47+
self.assertIsNotNone(response)
4748
self.connection.socket.close()
4849
connection.close()
4950

@@ -54,7 +55,8 @@ def test_signin_namespace(self):
5455
"username": "test",
5556
"password": "test",
5657
}
57-
_ = connection.signin(vars)
58+
response = connection.signin(vars)
59+
self.assertIsNotNone(response)
5860
_ = self.connection.query("DELETE user;")
5961
_ = self.connection.query("REMOVE TABLE user;")
6062
self.connection.socket.close()
@@ -68,7 +70,8 @@ def test_signin_database(self):
6870
"username": "test",
6971
"password": "test",
7072
}
71-
_ = connection.signin(vars)
73+
response = connection.signin(vars)
74+
self.assertIsNotNone(response)
7275
_ = self.connection.query("DELETE user;")
7376
_ = self.connection.query("REMOVE TABLE user;")
7477
self.connection.socket.close()
@@ -85,8 +88,8 @@ def test_signin_record(self):
8588
}
8689
}
8790
connection = BlockingWsSurrealConnection(self.url)
88-
# for below if client is HTTP then persist and attach to all headers
89-
_ = connection.signin(vars)
91+
response = connection.signin(vars)
92+
self.assertIsNotNone(response)
9093

9194
outcome = connection.info()
9295
self.assertEqual(outcome["email"], "test@gmail.com")

tests/unit_tests/connections/signup/test_blocking_http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def test_signup(self):
4848
}
4949
}
5050
connection = BlockingHttpSurrealConnection(self.url)
51-
# for below if client is HTTP then persist and attach to all headers
52-
_ = connection.signup(vars)
51+
response = connection.signup(vars)
52+
self.assertIsNotNone(response)
5353

5454
outcome = connection.info()
5555
self.assertEqual(outcome["email"], "test@gmail.com")

tests/unit_tests/connections/signup/test_blocking_ws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def test_signup(self):
4848
}
4949
}
5050
connection = BlockingWsSurrealConnection(self.url)
51-
# for below if client is HTTP then persist and attach to all headers
52-
_ = connection.signup(vars)
51+
response = connection.signup(vars)
52+
self.assertIsNotNone(response)
5353

5454
outcome = connection.info()
5555
self.assertEqual(outcome["email"], "test@gmail.com")

0 commit comments

Comments
 (0)