equal
deleted
inserted
replaced
13 # |
13 # |
14 # Description: |
14 # Description: |
15 # |
15 # |
16 |
16 |
17 import unittest |
17 import unittest |
18 import string |
18 import os |
19 import sys,os |
|
20 import pickle |
|
21 import time |
|
22 import __init__ |
|
23 |
19 |
24 from cone.public import api, exceptions |
|
25 from cone.storage import webstorage |
20 from cone.storage import webstorage |
26 from cone.carbon import model |
21 from cone.carbon import model |
27 import simplewebserver |
22 import simplewebserver |
28 |
23 |
29 ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) |
24 ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) |
30 TEST_SERVER = simplewebserver.SimpleWebServer(os.path.join(ROOT_PATH,'carbondata'), 8001) |
25 #TEST_SERVER = simplewebserver.SimpleWebServer(os.path.join(ROOT_PATH,'carbondata'), 8001) |
31 # |
26 # |
32 #def runserver(): |
27 #def runserver(): |
33 # if not TEST_SERVER.active: |
28 # if not TEST_SERVER.active: |
34 # TEST_SERVER.start() |
29 # TEST_SERVER.start() |
35 # time.sleep(1) |
30 # time.sleep(1) |
100 'featurelists/test.confml', |
95 'featurelists/test.confml', |
101 'test.confml']) |
96 'test.confml']) |
102 self.assertEquals(rc.get_resource_link('test.confml'), 'test.configurationroot') |
97 self.assertEquals(rc.get_resource_link('test.confml'), 'test.configurationroot') |
103 self.assertEquals(rc.get_resource_link('featurelists/test.confml'), 'test.featurelist') |
98 self.assertEquals(rc.get_resource_link('featurelists/test.confml'), 'test.featurelist') |
104 self.assertEquals(rc.get_resource_link('test/root.confml'), 'test.configurationlayer') |
99 self.assertEquals(rc.get_resource_link('test/root.confml'), 'test.configurationlayer') |
|
100 |
|
101 |
|
102 class TestCarbonExtapi(unittest.TestCase): |
|
103 def test_username_password(self): |
|
104 extapi = webstorage.CarbonExtapi("/") |
|
105 self.assertNotEqual(extapi,None) |
|
106 self.assertNotEqual(extapi.get_username(),"") |
105 |
107 |
106 |
|
107 |
108 |
108 if __name__ == '__main__': |
109 if __name__ == '__main__': |
109 unittest.main() |
110 unittest.main() |
110 |
111 |