Skip to content

Commit df8eebd

Browse files
author
Nemirtingas
committed
Try to add test without mail
1 parent 3632df4 commit df8eebd

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

tests/e2e/test_bitwarden.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,31 @@
1111
client_id = os.environ.get("BITWARDEN_CLIENT_ID", None)
1212
client_secret = os.environ.get("BITWARDEN_CLIENT_SECRET", None)
1313
device_id = os.environ.get("BITWARDEN_DEVICE_ID", None)
14-
bitwarden = BitwardenAPIClient(
15-
url, email, password, client_id, client_secret, device_id
16-
)
1714

1815
# Get test organization id from environment variables
1916
test_organization = os.environ.get("BITWARDEN_TEST_ORGANIZATION", None)
2017

18+
client_with_mail = BitwardenAPIClient(
19+
url,
20+
email,
21+
password,
22+
client_id,
23+
client_secret,
24+
device_id,
25+
)
26+
27+
client_without_mail = BitwardenAPIClient(
28+
url,
29+
None,
30+
password,
31+
client_id,
32+
client_secret,
33+
device_id,
34+
)
2135

22-
class BitwardenBasic(unittest.TestCase):
23-
def setUp(self) -> None:
24-
self.organization = get_organization(bitwarden, test_organization)
36+
class BitwardenBaseTests:
37+
def setUpBase(self):
38+
self.organization = get_organization(self.bitwarden, test_organization)
2539
self.test_colls_names = self.organization.collections(as_dict=True)
2640
self.test_colls_ids = self.organization.collections()
2741
self.test_users = self.organization.users()
@@ -127,6 +141,15 @@ def test_deduplicate(self):
127141
# Todo build test fixtures and delete them at the end of the test
128142
return
129143

144+
class BitwardenWithEmailTests(unittest.TestCase, BitwardenBaseTests):
145+
def setUp(self):
146+
self.bitwarden = client_with_mail
147+
self.setUpBase()
148+
149+
class BitwardenWithoutEmailTests(unittest.TestCase, BitwardenBaseTests):
150+
def setUp(self):
151+
self.bitwarden = client_without_mail
152+
self.setUpBase()
130153

131154
if __name__ == "__main__":
132155
unittest.main()

0 commit comments

Comments
 (0)