File tree 4 files changed +13
-12
lines changed
4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change
1
+ [pytest]
2
+ junit_family =xunit1
3
+ filterwarnings = ignore:.*pep8.*
Original file line number Diff line number Diff line change 1
1
[tox]
2
- envlist = py35, py36
2
+ envlist = py35, py36, py37, py38
3
3
4
4
[testenv]
5
5
deps =
6
- pylint ==1.7 .*
7
- pytest ==2.9.1
8
- pytest-cov ==2.2.1
9
- pytest-pep8 ==1.0.6
6
+ pylint ==2 .*
7
+ pytest ==5.*
8
+ pytest-cov ==2.*
9
+ pytest-pep8 ==1.*
10
10
commands =
11
11
py.test \
12
12
--cov ={envsitepackagesdir}/updatehub \
Original file line number Diff line number Diff line change 18
18
import json
19
19
20
20
21
- class Api ( object ) :
21
+ class Api :
22
22
"""
23
23
Api class used to access the agent API. Must be executed on the host that
24
24
is running the agent.
Original file line number Diff line number Diff line change 7
7
8
8
import io
9
9
import os
10
+ import sys
10
11
import socket
11
12
import threading
12
13
13
-
14
14
from enum import Enum
15
15
from enum import unique
16
16
@@ -57,7 +57,7 @@ class State(Enum):
57
57
ERROR = "error"
58
58
59
59
60
- class StateCommand ( object ) :
60
+ class StateCommand :
61
61
"""
62
62
A command class whose objects can be used to send commands back to the
63
63
agent.
@@ -107,17 +107,15 @@ class MalformedState(Exception):
107
107
Exception class raised on errors of the communication protocol on the
108
108
socket.
109
109
"""
110
- pass
111
110
112
111
113
112
class StateError (Exception ):
114
113
"""
115
114
Exception class raised when receiving errors from the agent execution.
116
115
"""
117
- pass
118
116
119
117
120
- class StateChangeListener ( object ) :
118
+ class StateChangeListener :
121
119
"""
122
120
Listener class for the agent. Objects from this class monitor a Unix socket
123
121
that will receive data from the agent, and triggers registered callbacks
@@ -210,7 +208,7 @@ def start(self):
210
208
"""
211
209
if not os .path .isfile (StateChangeListener .SDK_TRIGGER_FILENAME ):
212
210
print ("updatehub-sdk-statechange-trigger not found!" )
213
- exit (1 )
211
+ sys . exit ()
214
212
215
213
self .running = True
216
214
self .thread .start ()
You can’t perform that action at this time.
0 commit comments