Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit f09cab7

Browse files
authored
Merge pull request #13 from Stewart86/add-tests
Add tests
2 parents 36d3a65 + 48336f6 commit f09cab7

File tree

64 files changed

+3790
-240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3790
-240
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,53 @@ jobs:
7373
- name: Run Nox
7474
run: |
7575
nox --force-color --python=${{ matrix.python-version }}
76+
77+
- name: Upload coverage data
78+
if: always() && matrix.session == 'tests'
79+
uses: "actions/[email protected]"
80+
with:
81+
name: coverage-data
82+
path: ".coverage.*"
83+
84+
coverage:
85+
runs-on: ubuntu-latest
86+
needs: tests
87+
steps:
88+
- name: Check out the repository
89+
uses: actions/[email protected]
90+
91+
- name: Set up Python 3.9
92+
uses: actions/[email protected]
93+
with:
94+
python-version: 3.9
95+
96+
- name: Upgrade pip
97+
run: |
98+
pip install --constraint=.github/workflows/constraints.txt pip
99+
pip --version
100+
101+
- name: Install Poetry
102+
run: |
103+
pip install --constraint=.github/workflows/constraints.txt poetry
104+
poetry --version
105+
106+
- name: Install Nox
107+
run: |
108+
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
109+
nox --version
110+
111+
- name: Download coverage data
112+
uses: actions/[email protected]
113+
with:
114+
name: coverage-data
115+
116+
- name: Combine coverage data and display human readable report
117+
run: |
118+
nox --force-color --session=coverage
119+
120+
- name: Create coverage report
121+
run: |
122+
nox --force-color --session=coverage -- xml
123+
124+
- name: Upload coverage report
125+
uses: codecov/[email protected]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,43 @@
11
from aiocloudflare.commons.unused import Unused
22

3+
from .apps.apps import Apps
4+
from .certificates.certificates import Certificates
5+
from .groups.groups import Groups
6+
from .identity_providers.identity_providers import IdentityProviders
7+
from .logs.logs import Logs
8+
from .organizations.organizations import Organizations
9+
from .service_tokens.service_tokens import ServiceTokens
10+
311

412
class Access(Unused):
513
_endpoint1 = "accounts"
614
_endpoint2 = "access"
715
_endpoint3 = None
16+
17+
@property
18+
def logs(self) -> Logs:
19+
return Logs(self._config, self._session)
20+
21+
@property
22+
def identity_providers(self) -> IdentityProviders:
23+
return IdentityProviders(self._config, self._session)
24+
25+
@property
26+
def organizations(self) -> Organizations:
27+
return Organizations(self._config, self._session)
28+
29+
@property
30+
def groups(self) -> Groups:
31+
return Groups(self._config, self._session)
32+
33+
@property
34+
def service_tokens(self) -> ServiceTokens:
35+
return ServiceTokens(self._config, self._session)
36+
37+
@property
38+
def certificates(self) -> Certificates:
39+
return Certificates(self._config, self._session)
40+
41+
@property
42+
def apps(self) -> Apps:
43+
return Apps(self._config, self._session)

aiocloudflare/api/accounts/access/apps/apps.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ class Apps(Auth):
1010
_endpoint2 = "access/apps"
1111
_endpoint3 = None
1212

13-
@property
14-
def ca(self) -> Ca:
15-
return Ca(self._config, self._session)
16-
1713
@property
1814
def policies(self) -> Policies:
1915
return Policies(self._config, self._session)
2016

2117
@property
2218
def revoke_tokens(self) -> RevokeTokens:
2319
return RevokeTokens(self._config, self._session)
20+
21+
@property
22+
def ca(self) -> Ca:
23+
return Ca(self._config, self._session)

aiocloudflare/api/accounts/accounts.py

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,85 +29,85 @@ class Accounts(Auth):
2929
_endpoint3 = None
3030

3131
@property
32-
def billing(self) -> Billing:
33-
return Billing(self._config, self._session)
34-
35-
@property
36-
def custom_pages(self) -> CustomPages:
37-
return CustomPages(self._config, self._session)
32+
def firewall(self) -> Firewall:
33+
return Firewall(self._config, self._session)
3834

3935
@property
40-
def members(self) -> Members:
41-
return Members(self._config, self._session)
36+
def diagnostics(self) -> Diagnostics:
37+
return Diagnostics(self._config, self._session)
4238

4339
@property
44-
def railguns(self) -> Railguns:
45-
return Railguns(self._config, self._session)
40+
def addressing(self) -> Addressing:
41+
return Addressing(self._config, self._session)
4642

4743
@property
48-
def registrar(self) -> Registrar:
49-
return Registrar(self._config, self._session)
44+
def rulesets(self) -> Rulesets:
45+
return Rulesets(self._config, self._session)
5046

5147
@property
52-
def roles(self) -> Roles:
53-
return Roles(self._config, self._session)
48+
def load_balancers(self) -> LoadBalancers:
49+
return LoadBalancers(self._config, self._session)
5450

5551
@property
5652
def rules(self) -> Rules:
5753
return Rules(self._config, self._session)
5854

5955
@property
60-
def rulesets(self) -> Rulesets:
61-
return Rulesets(self._config, self._session)
56+
def access(self) -> Access:
57+
return Access(self._config, self._session)
58+
59+
@property
60+
def members(self) -> Members:
61+
return Members(self._config, self._session)
62+
63+
@property
64+
def roles(self) -> Roles:
65+
return Roles(self._config, self._session)
6266

6367
@property
6468
def storage(self) -> Storage:
6569
return Storage(self._config, self._session)
6670

6771
@property
68-
def subscriptions(self) -> Subscriptions:
69-
return Subscriptions(self._config, self._session)
72+
def audit_logs(self) -> AuditLogs:
73+
return AuditLogs(self._config, self._session)
7074

7175
@property
72-
def tunnels(self) -> Tunnels:
73-
return Tunnels(self._config, self._session)
76+
def railguns(self) -> Railguns:
77+
return Railguns(self._config, self._session)
78+
79+
@property
80+
def secondary_dns(self) -> SecondaryDns:
81+
return SecondaryDns(self._config, self._session)
7482

7583
@property
7684
def virtual_dns(self) -> VirtualDns:
7785
return VirtualDns(self._config, self._session)
7886

7987
@property
80-
def workers(self) -> Workers:
81-
return Workers(self._config, self._session)
88+
def tunnels(self) -> Tunnels:
89+
return Tunnels(self._config, self._session)
8290

8391
@property
84-
def addressing(self) -> Addressing:
85-
return Addressing(self._config, self._session)
92+
def custom_pages(self) -> CustomPages:
93+
return CustomPages(self._config, self._session)
8694

8795
@property
88-
def audit_logs(self) -> AuditLogs:
89-
return AuditLogs(self._config, self._session)
96+
def workers(self) -> Workers:
97+
return Workers(self._config, self._session)
9098

9199
@property
92-
def load_balancers(self) -> LoadBalancers:
93-
return LoadBalancers(self._config, self._session)
100+
def registrar(self) -> Registrar:
101+
return Registrar(self._config, self._session)
94102

95103
@property
96-
def firewall(self) -> Firewall:
97-
return Firewall(self._config, self._session)
104+
def subscriptions(self) -> Subscriptions:
105+
return Subscriptions(self._config, self._session)
98106

99107
@property
100-
def secondary_dns(self) -> SecondaryDns:
101-
return SecondaryDns(self._config, self._session)
108+
def billing(self) -> Billing:
109+
return Billing(self._config, self._session)
102110

103111
@property
104112
def stream(self) -> Stream:
105113
return Stream(self._config, self._session)
106-
107-
@property
108-
def access(self) -> Access:
109-
return Access(self._config, self._session)
110-
111-
@property
112-
def diagnostics(self) -> Diagnostics:
113-
return Diagnostics(self._config, self._session)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
from aiocloudflare.commons.unused import Unused
22

3+
from .prefixes.prefixes import Prefixes
4+
35

46
class Addressing(Unused):
57
_endpoint1 = "accounts"
68
_endpoint2 = "addressing"
79
_endpoint3 = None
10+
11+
@property
12+
def prefixes(self) -> Prefixes:
13+
return Prefixes(self._config, self._session)

aiocloudflare/api/accounts/addressing/prefixes/prefixes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ class Prefixes(Auth):
99
_endpoint2 = "addressing/prefixes"
1010
_endpoint3 = None
1111

12-
@property
13-
def bgp(self) -> Bgp:
14-
return Bgp(self._config, self._session)
15-
1612
@property
1713
def delegations(self) -> Delegations:
1814
return Delegations(self._config, self._session)
15+
16+
@property
17+
def bgp(self) -> Bgp:
18+
return Bgp(self._config, self._session)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
from aiocloudflare.commons.unused import Unused
22

3+
from .profile.profile import Profile
4+
35

46
class Billing(Unused):
57
_endpoint1 = "accounts"
68
_endpoint2 = "billing"
79
_endpoint3 = None
10+
11+
@property
12+
def profile(self) -> Profile:
13+
return Profile(self._config, self._session)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
from aiocloudflare.commons.unused import Unused
22

3+
from .traceroute.traceroute import Traceroute
4+
35

46
class Diagnostics(Unused):
57
_endpoint1 = "accounts"
68
_endpoint2 = "diagnostics"
79
_endpoint3 = None
10+
11+
@property
12+
def traceroute(self) -> Traceroute:
13+
return Traceroute(self._config, self._session)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
from aiocloudflare.commons.unused import Unused
22

3+
from .access_rules.access_rules import AccessRules
4+
35

46
class Firewall(Unused):
57
_endpoint1 = "accounts"
68
_endpoint2 = "firewall"
79
_endpoint3 = None
10+
11+
@property
12+
def access_rules(self) -> AccessRules:
13+
return AccessRules(self._config, self._session)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
from aiocloudflare.commons.unused import Unused
22

3+
from .monitors.monitors import Monitors
4+
from .pools.pools import Pools
5+
from .preview.preview import Preview
6+
from .regions.regions import Regions
7+
from .search.search import Search
8+
39

410
class LoadBalancers(Unused):
511
_endpoint1 = "accounts"
612
_endpoint2 = "load_balancers"
713
_endpoint3 = None
14+
15+
@property
16+
def search(self) -> Search:
17+
return Search(self._config, self._session)
18+
19+
@property
20+
def pools(self) -> Pools:
21+
return Pools(self._config, self._session)
22+
23+
@property
24+
def preview(self) -> Preview:
25+
return Preview(self._config, self._session)
26+
27+
@property
28+
def monitors(self) -> Monitors:
29+
return Monitors(self._config, self._session)
30+
31+
@property
32+
def regions(self) -> Regions:
33+
return Regions(self._config, self._session)

0 commit comments

Comments
 (0)