FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-patterns/test_borg.py at master · sd2017/python-patterns · GitHub
sd2017
/
python-patterns
Public
forked from
faif/python-patterns
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-patterns
/
test_borg.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (25 loc) · 857 Bytes
Breadcrumbs
python-patterns
/
test_borg.py
Copy path
File metadata and controls
32 lines (25 loc) · 857 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
from
borg
import
Borg
,
YourBorg
import
sys
if
sys
.
version_info
<
(
2
,
7
):
import
unittest2
as
unittest
else
:
import
unittest
class
BorgTest
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
self
):
self
.
b1
=
Borg
()
self
.
b2
=
Borg
()
self
.
ib1
=
YourBorg
()
def
test_initial_borg_state_shall_be_init
(
self
):
b
=
Borg
()
self
.
assertEqual
(
b
.
state
,
'Init'
)
def
test_changing_instance_attribute_shall_change_borg_state
(
self
):
self
.
b1
.
state
=
'Running'
self
.
assertEqual
(
self
.
b1
.
state
,
'Running'
)
self
.
assertEqual
(
self
.
b2
.
state
,
'Running'
)
self
.
assertEqual
(
self
.
ib1
.
state
,
'Running'
)
def
test_instances_shall_have_own_ids
(
self
):
self
.
assertNotEqual
(
id
(
self
.
b1
),
id
(
self
.
b2
),
id
(
self
.
ib1
))
if
__name__
==
"__main__"
:
unittest
.
main
()
Back
|
FazBrowse Home
|
New Git URL