cleaning what I touched
@@ -94,7 +94,7 @@ def test_start_vent_collector():
mock_response.text = "success"
# cover object
a = mock_response()
- assert a == None
+ assert a is None
assert mock_response.text == "success"
return mock_response
@@ -184,7 +184,6 @@ def test_format_rabbit_message():
assert retval == {}
-
def test_rabbit_callback():
def mock_method(): return True
mock_method.routing_key = "test_routing_key"
@@ -466,26 +465,43 @@ def test_update_next_state():
ml_return = {
'NOT_FOUND': {
- 'valid': True, 'classification': {
+ 'valid': True,
+ 'classification': {
'labels': [
- 'Unknown', 'Smartphone', 'Developer workstation'], 'confidences': [
- 0.9983864533039954, 0.0010041873867962805, 0.00042691313815914093]}, 'timestamp': 1508366767.45571, 'decisions': {
- 'investigate': True, 'behavior': 'normal'}}}
+ 'Unknown',
+ 'Smartphone',
+ 'Developer workstation'],
+ 'confidences': [
+ 0.9983864533039954,
+ 0.0010041873867962805,
+ 0.00042691313815914093]},
+ 'timestamp': 1508366767.45571,
+ 'decisions': {
+ 'investigate': True,
+ 'behavior': 'normal'}}}
monitor.update_next_state(ml_return)
ml_return = {
'd60c5fa5c980b1cd791208eaf62aba9fb46d3aa3': {
- 'valid': False, 'classification': {
+ 'valid': False,
+ 'classification': {
'labels': [
- 'Unknown', 'Smartphone', 'Developer workstation'], 'confidences': [
- 0.9983864533039954, 0.0010041873867962805, 0.00042691313815914093]}, 'timestamp': 1508366767.45571, 'decisions': {
- 'investigate': True, 'behavior': 'normal'}}}
+ 'Unknown',
+ 'Smartphone',
+ 'Developer workstation'],
+ 'confidences': [
+ 0.9983864533039954,
+ 0.0010041873867962805,
+ 0.00042691313815914093]},
+ 'timestamp': 1508366767.45571,
+ 'decisions': {
+ 'investigate': True,
+ 'behavior': 'normal'}}}
monitor.update_next_state(ml_return)
-
def test_configSelf():
class MockMonitor(Monitor):
