예제 #1
0
    def test_model(self):
        model = MVC.Model()
        question, possible_answers = model.question_and_answers()

        # can't test what they are because they're random
        self.assertTrue(isinstance(question, str),
                        "Question should be a string")
        self.assertTrue(isinstance(possible_answers, list),
                        "Answers should be a list")

        for item in possible_answers:
            self.assertTrue(
                isinstance(item[0], str),
                "Elements of possible answer list should be strings")
예제 #2
0
from PIL import ImageTk, Image
from tkinter import Tk, filedialog, simpledialog, Frame, LabelFrame, Label, Button, Menu
import platform
import csv
import MVC
import threading
# Root window created, can add more later
# windows within windows.
root = Tk()
c = MVC.Controller(MVC.Model(), MVC.View())


class Window(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.master = master
        self.init_window()

    # Creation of init_window
    def init_window(self):

        # changing the title of our master widget
        self.master.title("GUI")


def popup():
    S1 = simpledialog.askstring('Input file name', 'file name')
    # prints the string typed in by the user, make a funtion to save the file by that name.
    print(S1)
    if platform.system() == 'Windows':
        newline = ''