Example #1
0
def remove(self):
    cv = content_view(service=None, prefix='view')
    cb = ContentBook()
    cb.add(cv)
    assert_equal(cb.get_n_pages(), 1)
    assert_equal(cb.has_uid(cv.unique_id), True)
    cb.remove_view(cv)
    assert_equal(cb.get_n_pages(), 0)
    assert_equal(cb.has_uid(cv.unique_id), False)
Example #2
0
def empty(self):
    cb = ContentBook()
    cv = content_view(service=None, prefix="view")
    cb.add(cv)

    def _e(cb):
        pass

    cb.connect("empty", _e)
Example #3
0
def remove(self):
    cv = content_view(service=None, prefix="view")
    cb = ContentBook()
    cb.add(cv)
    assert_equal(cb.get_n_pages(), 1)
    assert_equal(cb.has_uid(cv.unique_id), True)
    cb.remove_view(cv)
    assert_equal(cb.get_n_pages(), 0)
    assert_equal(cb.has_uid(cv.unique_id), False)
Example #4
0
def newly_active(self):
    cb = ContentBook()
    cv = content_view(service=None, prefix='view')
    cb.add(cv)
    cv = content_view(service=None, prefix='view')
    cb.add(cv)
    assert_equal(cb.get_current_page(), 1)
Example #5
0
def newly_active(self):
    cb = ContentBook()
    cv = content_view(service=None, prefix="view")
    cb.add(cv)
    cv = content_view(service=None, prefix="view")
    cb.add(cv)
    assert_equal(cb.get_current_page(), 1)
Example #6
0
def empty(self):
    cb = ContentBook()
    cv = content_view(service=None, prefix='view')
    cb.add(cv)

    def _e(cb):
        pass

    cb.connect('empty', _e)
Example #7
0
def empty(self):
    cb = ContentBook()
    assert_equal(cb.get_n_pages(), 0)
Example #8
0
def cycle(self):
    cb = ContentBook()
    cv = content_view(service=None, prefix="view")
    cb.add(cv)
    cv = content_view(service=None, prefix="view")
    cb.add(cv)
    assert_equal(cb.get_current_page(), 1)
    cb.next_page()
    assert_equal(cb.get_current_page(), 0)
    cb.prev_page()
    assert_equal(cb.get_current_page(), 1)
Example #9
0
def empty(self):
    cb = ContentBook()
    assert_equal(cb.get_n_pages(), 0)
Example #10
0
def cycle(self):
    cb = ContentBook()
    cv = content_view(service=None, prefix='view')
    cb.add(cv)
    cv = content_view(service=None, prefix='view')
    cb.add(cv)
    assert_equal(cb.get_current_page(), 1)
    cb.next_page()
    assert_equal(cb.get_current_page(), 0)
    cb.prev_page()
    assert_equal(cb.get_current_page(), 1)