|
19 | 19 | ZonesClient, |
20 | 20 | ) |
21 | 21 |
|
22 | | -from ..conftest import assert_bound_action1 |
| 22 | +from ..conftest import BoundModelTestCase, assert_bound_action1 |
23 | 23 |
|
24 | 24 |
|
25 | 25 | def assert_bound_zone1(o: BoundZone, client: ZonesClient): |
@@ -847,13 +847,35 @@ def test_set_rrset_records( |
847 | 847 | assert_bound_action1(action, resource_client._parent.actions) |
848 | 848 |
|
849 | 849 |
|
850 | | -class TestBoundZone: |
| 850 | +class TestBoundZone(BoundModelTestCase): |
| 851 | + methods = [ |
| 852 | + BoundZone.update, |
| 853 | + BoundZone.delete, |
| 854 | + BoundZone.import_zonefile, |
| 855 | + BoundZone.export_zonefile, |
| 856 | + BoundZone.change_primary_nameservers, |
| 857 | + BoundZone.change_ttl, |
| 858 | + BoundZone.change_protection, |
| 859 | + BoundZone.get_rrset_all, |
| 860 | + BoundZone.get_rrset_list, |
| 861 | + BoundZone.get_rrset, |
| 862 | + BoundZone.create_rrset, |
| 863 | + # With rrset sub resource |
| 864 | + (BoundZone.update_rrset, {"sub_resource": True}), |
| 865 | + (BoundZone.delete_rrset, {"sub_resource": True}), |
| 866 | + (BoundZone.change_rrset_protection, {"sub_resource": True}), |
| 867 | + (BoundZone.change_rrset_ttl, {"sub_resource": True}), |
| 868 | + (BoundZone.add_rrset_records, {"sub_resource": True}), |
| 869 | + (BoundZone.remove_rrset_records, {"sub_resource": True}), |
| 870 | + (BoundZone.set_rrset_records, {"sub_resource": True}), |
| 871 | + ] |
| 872 | + |
851 | 873 | @pytest.fixture() |
852 | 874 | def resource_client(self, client: Client): |
853 | 875 | return client.zones |
854 | 876 |
|
855 | 877 | @pytest.fixture() |
856 | | - def bound_model(self, resource_client, zone1): |
| 878 | + def bound_model(self, resource_client: ZonesClient, zone1): |
857 | 879 | return BoundZone(resource_client, data=zone1) |
858 | 880 |
|
859 | 881 | def test_init(self, resource_client: ZonesClient, bound_model: BoundZone): |
@@ -898,13 +920,23 @@ def test_init(self, resource_client: ZonesClient, bound_model: BoundZone): |
898 | 920 | assert o.registrar == "hetzner" |
899 | 921 |
|
900 | 922 |
|
901 | | -class TestBoundZoneRRSet: |
| 923 | +class TestBoundZoneRRSet(BoundModelTestCase): |
| 924 | + methods = [ |
| 925 | + BoundZoneRRSet.update_rrset, |
| 926 | + BoundZoneRRSet.delete_rrset, |
| 927 | + BoundZoneRRSet.change_rrset_protection, |
| 928 | + BoundZoneRRSet.change_rrset_ttl, |
| 929 | + BoundZoneRRSet.add_rrset_records, |
| 930 | + BoundZoneRRSet.remove_rrset_records, |
| 931 | + BoundZoneRRSet.set_rrset_records, |
| 932 | + ] |
| 933 | + |
902 | 934 | @pytest.fixture() |
903 | 935 | def resource_client(self, client: Client): |
904 | 936 | return client.zones |
905 | 937 |
|
906 | 938 | @pytest.fixture() |
907 | | - def bound_model(self, resource_client, zone_rrset1): |
| 939 | + def bound_model(self, resource_client: ZonesClient, zone_rrset1): |
908 | 940 | return BoundZoneRRSet(resource_client, data=zone_rrset1) |
909 | 941 |
|
910 | 942 | def test_init(self, resource_client: ZonesClient, bound_model: BoundZoneRRSet): |
|
0 commit comments