-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathtest_domain.py
More file actions
36 lines (29 loc) · 864 Bytes
/
test_domain.py
File metadata and controls
36 lines (29 loc) · 864 Bytes
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
33
34
35
36
from __future__ import annotations
import datetime
from datetime import timezone
import pytest
from hcloud.firewalls import (
Firewall,
FirewallResource,
FirewallResourceAppliedToResources,
FirewallResourceLabelSelector,
FirewallRule,
)
@pytest.mark.parametrize(
"value",
[
(Firewall(id=1),),
(FirewallRule(direction="in", protocol="icmp", source_ips=[]),),
(FirewallResource(type="server"),),
(FirewallResourceAppliedToResources(type="server"),),
(FirewallResourceLabelSelector(),),
],
)
def test_eq(value):
assert value.__eq__(value)
class TestFirewall:
def test_created_is_datetime(self):
firewall = Firewall(id=1, created="2016-01-30T23:50+00:00")
assert firewall.created == datetime.datetime(
2016, 1, 30, 23, 50, tzinfo=timezone.utc
)