|
7 | 7 | from __future__ import unicode_literals |
8 | 8 |
|
9 | 9 | import json |
10 | | -import os.path |
11 | 10 |
|
12 | 11 | from django.test import TestCase |
13 | 12 | from django.test.utils import override_settings |
14 | 13 |
|
15 | 14 | from api.models import Key |
16 | | -from deis import settings |
17 | 15 |
|
18 | 16 |
|
19 | 17 | PUBKEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfQkkUUoxpvcNMkvv7jqnfodgs37M2eBO" \ |
@@ -55,29 +53,6 @@ def test_key(self): |
55 | 53 | response = self.client.delete(url) |
56 | 54 | self.assertEqual(response.status_code, 204) |
57 | 55 |
|
58 | | - def test_key_cm(self): |
59 | | - """ |
60 | | - Test that creating and deleting a key updates configuration management |
61 | | - """ |
62 | | - url = '/api/keys' |
63 | | - body = {'id': 'mykey@box.local', 'public': PUBKEY} |
64 | | - response = self.client.post(url, json.dumps(body), content_type='application/json') |
65 | | - self.assertEqual(response.status_code, 201) |
66 | | - key_id = response.data['id'] |
67 | | - path = os.path.join(settings.TEMPDIR, 'user-autotest') |
68 | | - with open(path) as f: |
69 | | - data = json.loads(f.read()) |
70 | | - self.assertIn('id', data) |
71 | | - self.assertEquals(data['id'], 'autotest') |
72 | | - self.assertIn(body['id'], data['ssh_keys']) |
73 | | - self.assertEqual(body['public'], data['ssh_keys'][body['id']]) |
74 | | - url = '/api/keys/{key_id}'.format(**locals()) |
75 | | - response = self.client.delete(url) |
76 | | - self.assertEqual(response.status_code, 204) |
77 | | - with open(path) as f: |
78 | | - data = json.loads(f.read()) |
79 | | - self.assertNotIn(body['id'], data['ssh_keys']) |
80 | | - |
81 | 56 | def test_key_duplicate(self): |
82 | 57 | """ |
83 | 58 | Test that a user cannot add a duplicate key |
|
0 commit comments