File size: 512 Bytes
df40774
cfc0db8
df40774
 
 
cfc0db8
df40774
 
 
 
 
 
 
 
 
 
 
33f6ee7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from megabots import create_interface


def test_create_interface():
    # create a mock Bot object
    class MockBot:
        def ask(self, question: str):
            return "Answer"

    # create a mock example
    example = [["What is your name?"], ["My name is Bot."]]

    # call the function with the mock bot and example
    interface = create_interface(MockBot(), examples=example)

    # check if the interface has the correct properties
    assert isinstance(interface, gr.Blocks)