Ejemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        super(SchonhageStorageModification, self).__init__(*args, **kwargs)
        self.DEBUG = False
        self.graph = DirectedGraph()
        if 'word' in kwargs:
            self.TEST_WORD = kwargs['word']
        else:
            self.TEST_WORD = 'Schonhage'
        self.word = strlist(list(self.TEST_WORD))  # TEST

        self.curr_key = 0
        self.curr_val = self.word[self.curr_key]
        self.output = self.curr_val

        # Setup initial graph with default word.
        self.recalculate()
        # Get node after the paths have been created.
        self.curr_node = self.graph[self.curr_key]
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        super(SchonhageStorageModification, self).__init__(*args, **kwargs)
        self.DEBUG = False
        self.graph = DirectedGraph()
        if 'word' in kwargs:
            self.TEST_WORD = kwargs['word']
        else:
            self.TEST_WORD = 'Schonhage'
        self.word = strlist(list(self.TEST_WORD))  # TEST

        self.curr_key = 0
        self.curr_val = self.word[self.curr_key]
        self.output = self.curr_val

        # Setup initial graph with default word.
        self.recalculate()
        # Get node after the paths have been created.
        self.curr_node = self.graph[self.curr_key]
Ejemplo n.º 3
0
 def test_split(self):
     _list = adts.strlist(['foo', 'bar'])
     _list.split()
     expected = [['f', 'o', 'o'], ['b', 'a', 'r']]
     for k, val in enumerate(_list):
         self.assertEqual(_list[k], expected[k])
Ejemplo n.º 4
0
 def test_reverse(self):
     _list = adts.strlist(['foo', 'bar'])
     _list.reverse()
     expected = ['oof', 'rab']
     for k, val in enumerate(_list):
         self.assertEqual(_list[k], expected[k])
Ejemplo n.º 5
0
 def test_down(self):
     _list = adts.strlist(['FOO', 'BAR'])
     _list.lo()
     expected = ['foo', 'bar']
     for k, val in enumerate(_list):
         self.assertEqual(_list[k], expected[k])
Ejemplo n.º 6
0
 def test_add(self):
     _list = adts.strlist(['foo', 'bar'])
     _list.add('2')
     expected = ['foo2', 'bar2']
     for k, val in enumerate(_list):
         self.assertEqual(_list[k], expected[k])
Ejemplo n.º 7
0
 def test_copy(self):
     _list = adts.strlist(['foo', 'bar'])
     _list.copy(2)
     expected = ['foofoo', 'barbar']
     for k, val in enumerate(_list):
         self.assertEqual(_list[k], expected[k])
Ejemplo n.º 8
0
 def test_strlist_extra(self):
     _list = adts.strlist(['a', 'b', 'c', 1, 2])
     expected = ['a', 'b', 'c']
     for k, val in enumerate(_list):
         self.assertEqual(_list[k], expected[k])