import unittest
from modelverse_state.main import ModelverseState

from modelverse_state import status

class TestCreateNode(unittest.TestCase):
    def setUp(self):
        self.mvs = ModelverseState()

    def test_create_node_different_id_simple(self):
        id1, r1 = self.mvs.create_node()
        id2, r2 = self.mvs.create_node()
        
        self.assertEquals(r1, status.SUCCESS)
        self.assertEquals(r2, status.SUCCESS)
        self.assertNotEquals(id1, id2)

    def test_create_node_different_id_long(self):
        results = set()
        for i in range(1000):
            v, r = self.mvs.create_node()
            self.assertEquals(r, status.SUCCESS)
            results.add(v)
        self.assertEquals(len(results), 1000)
