mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-15 17:40:50 -07:00
[GCP] Forwarding Rule module (#24627)
* [GCP] Forwarding Rule module * pep8 formatting for tests * remove py26 check and updated_ key; docs and typo fixes
This commit is contained in:
parent
7bb0a8d4fc
commit
07c55b855a
2 changed files with 392 additions and 0 deletions
30
test/units/modules/cloud/google/test_gcp_forwarding_rule.py
Normal file
30
test/units/modules/cloud/google/test_gcp_forwarding_rule.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
import unittest
|
||||
|
||||
from ansible.modules.cloud.google.gcp_forwarding_rule import _build_global_forwarding_rule_dict
|
||||
|
||||
|
||||
class TestGCPFowardingRule(unittest.TestCase):
|
||||
"""Unit tests for gcp_fowarding_rule module."""
|
||||
params_dict = {
|
||||
'forwarding_rule_name': 'foo_fowarding_rule_name',
|
||||
'address': 'foo_external_address',
|
||||
'target': 'foo_targetproxy',
|
||||
'region': 'global',
|
||||
'port_range': 80,
|
||||
'protocol': 'TCP',
|
||||
'state': 'present',
|
||||
}
|
||||
|
||||
def test__build_global_forwarding_rule_dict(self):
|
||||
|
||||
expected = {
|
||||
'name': 'foo_fowarding_rule_name',
|
||||
'IPAddress': 'https://www.googleapis.com/compute/v1/projects/my-project/global/addresses/foo_external_address',
|
||||
'target': 'https://www.googleapis.com/compute/v1/projects/my-project/global/targetHttpProxies/foo_targetproxy',
|
||||
'region': 'global',
|
||||
'portRange': 80,
|
||||
'IPProtocol': 'TCP',
|
||||
}
|
||||
actual = _build_global_forwarding_rule_dict(
|
||||
self.params_dict, 'my-project')
|
||||
self.assertEqual(expected, actual)
|
Loading…
Add table
Add a link
Reference in a new issue