Skip to content

Commit

Permalink
Removing mock errors from tests where they're not interesting
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlynch committed Apr 4, 2016
1 parent 365f72c commit 7dc8d4d
Showing 1 changed file with 4 additions and 44 deletions.
48 changes: 4 additions & 44 deletions tests/test_result_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ def test_encodes_correctly_when_c2s_result_is_missing(self):
pytz.utc),
throughput=98.235)
result.latency = 23.8
result.errors = [
results.TestError(
datetime.datetime(2016, 2, 26, 15, 53, 29, 123456, pytz.utc),
'mock error message 1'),
]
encoded_expected = """
{
"start_time": "2016-02-26T15:51:23.452234Z",
Expand All @@ -252,12 +247,7 @@ def test_encodes_correctly_when_c2s_result_is_missing(self):
"s2c_end_time": "2016-02-26T15:51:45.123456Z",
"s2c_throughput": 98.235,
"latency": 23.8,
"errors": [
{
"timestamp": "2016-02-26T15:53:29.123456Z",
"message": "mock error message 1"
}
]
"errors": []
}"""

encoded_actual = self.encoder.encode(result)
Expand All @@ -280,11 +270,6 @@ def test_encodes_correctly_when_s2c_result_is_missing(self):
pytz.utc),
throughput=10.127)
result.latency = 23.8
result.errors = [
results.TestError(
datetime.datetime(2016, 2, 26, 15, 53, 29, 123456, pytz.utc),
'mock error message 1'),
]
encoded_expected = """
{
"start_time": "2016-02-26T15:51:23.452234Z",
Expand All @@ -300,12 +285,7 @@ def test_encodes_correctly_when_s2c_result_is_missing(self):
"s2c_end_time": null,
"s2c_throughput": null,
"latency": 23.8,
"errors": [
{
"timestamp": "2016-02-26T15:53:29.123456Z",
"message": "mock error message 1"
}
]
"errors": []
}"""

encoded_actual = self.encoder.encode(result)
Expand Down Expand Up @@ -333,11 +313,6 @@ def test_encodes_correctly_when_latency_is_missing(self):
end_time=datetime.datetime(2016, 2, 26, 15, 51, 45, 123456,
pytz.utc),
throughput=98.235)
result.errors = [
results.TestError(
datetime.datetime(2016, 2, 26, 15, 53, 29, 123456, pytz.utc),
'mock error message 1'),
]
encoded_expected = """
{
"start_time": "2016-02-26T15:51:23.452234Z",
Expand All @@ -353,12 +328,7 @@ def test_encodes_correctly_when_latency_is_missing(self):
"s2c_end_time": "2016-02-26T15:51:45.123456Z",
"s2c_throughput": 98.235,
"latency": null,
"errors": [
{
"timestamp": "2016-02-26T15:53:29.123456Z",
"message": "mock error message 1"
}
]
"errors": []
}"""

encoded_actual = self.encoder.encode(result)
Expand Down Expand Up @@ -388,11 +358,6 @@ def test_encodes_zero_valued_metrics(self):
pytz.utc),
throughput=0.0)
result.latency = 0.0
result.errors = [
results.TestError(
datetime.datetime(2016, 2, 26, 15, 53, 29, 123456, pytz.utc),
'mock error message 1'),
]
encoded_expected = """
{
"start_time": "2016-02-26T15:51:23.452234Z",
Expand All @@ -408,12 +373,7 @@ def test_encodes_zero_valued_metrics(self):
"s2c_end_time": "2016-02-26T15:51:45.123456Z",
"s2c_throughput": 0.0,
"latency": 0.0,
"errors": [
{
"timestamp": "2016-02-26T15:53:29.123456Z",
"message": "mock error message 1"
}
]
"errors": []
}"""

encoded_actual = self.encoder.encode(result)
Expand Down

0 comments on commit 7dc8d4d

Please sign in to comment.