X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_registration_string.py;fp=tests%2Funit%2Ftest_registration_string.py;h=f4fea449674d6f95f0ff8de266beea0840b6ce55;hp=0000000000000000000000000000000000000000;hb=b8a8281b1785358bd5632a119c016f21811172c6;hpb=dcdf82bbc1ef310379f746518b2dd3b006353cb3 diff --git a/tests/unit/test_registration_string.py b/tests/unit/test_registration_string.py new file mode 100644 index 0000000..f4fea44 --- /dev/null +++ b/tests/unit/test_registration_string.py @@ -0,0 +1,18 @@ +# +# Test our placement helper +# + +import unittest + +from juju.utils import generate_user_controller_access_token + + +class TestRegistrationString(unittest.TestCase): + def test_generate_user_controller_access_token(self): + controller_name = "localhost-localhost" + endpoints = ["192.168.1.1:17070", "192.168.1.2:17070", "192.168.1.3:17070"] + username = "test-01234" + secret_key = "paNZrqOw51ONk1kTER6rkm4hdPcg5VgC/dzXYxtUZaM=" + reg_string = generate_user_controller_access_token(username, endpoints, secret_key, controller_name) + assert reg_string == b"MH4TCnRlc3QtMDEyMzQwORMRMTkyLjE2OC4xLjE6MTcwNzATETE5Mi4xNjguMS4yOjE3MDcwExExOTIuMTY4" \ + b"LjEuMzoxNzA3MAQgpaNZrqOw51ONk1kTER6rkm4hdPcg5VgC_dzXYxtUZaMTE2xvY2FsaG9zdC1sb2NhbGhvc3QA"