예제 #1
0
    def test_is_user_admin(self):

        test_student_id = 1

        status = admin.is_user_admin(test_student_id)

        it(status).should.be_equal(True)
예제 #2
0
    def test_get_id_of_state(self):

        test_description = "wait_call_text"

        state = bot.get_id_of_state(test_description)

        it(state).should.be_equal(5)
예제 #3
0
    def test_get_active_group(self):

        test_student_id = 1

        group = admin.get_active_group(test_student_id)

        it(group).should.be_equal(Group.get_by_id(2))
예제 #4
0
    def test_get_active_group_of_non_admin(self):

        test_student_id = 3

        group = admin.get_active_group(test_student_id)

        it(group).should.be_equal(None)
예제 #5
0
    def test_get_admin_storage(self):

        test_student_id = 1

        store = admin.get_admin_storage(test_student_id)

        it(store).should.be_an_instance_of(Storage)
예제 #6
0
    def test_get_non_admin_storage(self):

        test_student_id = 3

        store = admin.get_admin_storage(test_student_id)

        it(store).should.be_an_instance_of(type(None))
예제 #7
0
    def test_is_non_admin_is_admin(self):

        test_student_id = 3

        status = admin.is_user_admin(test_student_id)

        it(status).should.be_equal(False)
예제 #8
0
    def test_get_admin_feud_of_non_admin(self):

        test_student_id = 3

        groups = admin.get_admin_feud(test_student_id)

        it(groups).should.be_equal([])
예제 #9
0
    def test_get_list_of_calling_students(self):

        test_admin_id = 1

        res = shortcuts.get_list_of_calling_students(test_admin_id)

        it(res).should.be_equal([1, 2, 3])
예제 #10
0
    def test_get_system_id_of_existing_student(self):

        test_student_id = 549350532

        student_id = students.get_system_id_of_student(test_student_id)

        it(student_id).should.be_equal(1)
예제 #11
0
    def test_get_unique_second_name_letters_in_a_group(self):

        test_user_id = 1

        snd_names = students.get_unique_second_name_letters_in_a_group(
            admin.get_active_group(test_user_id), )

        it(snd_names).should.be_equal(list("БВКМНСТ"))
예제 #12
0
    def test_get_active_chat(self):

        test_admin_id = 1
        test_chat = Chat.get(id=2)

        res = shortcuts.get_active_chat(test_admin_id)

        it(res).should.be_equal(test_chat)
예제 #13
0
    def test_get_list_of_students_by_letter(self):

        test_letter = "Б"
        test_user_id = 1
        test_student = Student.get_by_id(4)

        st = students.get_list_of_students_by_letter(test_user_id, test_letter)

        it(st).should.be_equal([test_student])
예제 #14
0
    def test_add_student_to_calling_list(self):

        test_admin_id = 1
        test_student_id = 3

        res = shortcuts.add_student_to_calling_list(test_admin_id,
                                                    test_student_id)
        data = list(map(int, res.selected_students.split(",")))
        it(data).should.be_equal([1, 2, 3])
예제 #15
0
    def test_invert_names_usage(self):

        test_admin_id = 1
        test_store = admin.get_admin_storage(test_admin_id)

        shortcuts.invert_names_usage(test_admin_id)
        res = shortcuts.invert_names_usage(test_admin_id)

        it(res.names_usage).should.be_equal(test_store.names_usage)
예제 #16
0
    def test_translate_string_en2ru(self):
        string = "ghbdtn"

        res = translate_string(string)

        it(res).should.be_equal("привет")
예제 #17
0
    def test_translate_string_ru2en(self):
        string = "руддщ"

        res = translate_string(string)

        it(res).should.be_equal("hello")
예제 #18
0
def expect_it(value):
    return pyshould.it(value)