Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyaven committed Jul 17, 2024
1 parent c770d2c commit 2314cda
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/pystackql_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,17 @@ def test_11a_execute_with_defaults_null_response(self):

@pystackql_test_setup(output='pandas')
def test_12_execute_with_pandas_output(self):
result = self.stackql.execute(aws_query)
# result = self.stackql.execute(aws_query)
result = self.stackql.execute(google_query)
is_valid_dataframe = isinstance(result, pd.DataFrame)
self.assertTrue(is_valid_dataframe, f"Result is not a valid DataFrame: {result}")
# Check datatypes of the columns
# expected_dtypes = {
# 'instance_type': 'object',
# 'num_instances': 'int64'
# }
expected_dtypes = {
'instance_type': 'str',
'status': 'object',
'num_instances': 'int64'
}
for col, expected_dtype in expected_dtypes.items():
Expand Down Expand Up @@ -281,14 +286,19 @@ def test_21_execute_server_mode_default_output(self):

@pystackql_test_setup(server_mode=True, output='pandas')
def test_22_execute_server_mode_pandas_output(self):
result = self.stackql.execute(aws_query)
# result = self.stackql.execute(aws_query)
result = self.stackql.execute(google_query)
is_valid_dataframe = isinstance(result, pd.DataFrame)
self.assertTrue(is_valid_dataframe, f"Result is not a valid DataFrame: {result}")
# Check datatypes of the columns
# expected_dtypes = {
# 'instance_type': 'object',
# 'num_instances': 'int64'
# }
expected_dtypes = {
'instance_type': 'str',
'status': 'object',
'num_instances': 'int64'
}
}
for col, expected_dtype in expected_dtypes.items():
actual_dtype = result[col].dtype
self.assertEqual(actual_dtype, expected_dtype, f"Column '{col}' has dtype '{actual_dtype}' but expected '{expected_dtype}'")
Expand Down

0 comments on commit 2314cda

Please sign in to comment.