Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import unittest import tkinter as tk from tkinter import ttk from craft _ workshop import WorkshopApp, Student, Course class TestWorkshopApp ( unittest . TestCase )

import unittest
import tkinter as tk
from tkinter import ttk
from craft_workshop import WorkshopApp, Student, Course
class TestWorkshopApp(unittest.TestCase):
def setUp(self):
self.root = tk.Tk()
self.app = WorkshopApp(self.root)
def show_student_details(self, student):
details_window = tk.Toplevel(self.root, name="details_window")
details_window.title("Student Details")
labels =["Name", "Home Phone", "Mobile Phone", "Address", "Email"]
entries ={}
for i, label in enumerate(labels):
ttk.Label(details_window, text=f"{label}:").grid(row=i, column=0, padx=5, pady=5)
entry = ttk.Entry(details_window)
entry.insert(0, getattr(student, label.lower().replace("","_")))
entry.grid(row=i, column=1, padx=5, pady=5)
entries[label]= entry
tree = ttk.Treeview(details_window, columns=('Course ID', 'Payment'), show='headings')
tree.heading('Course ID', text='Course ID')
tree.heading('Payment', text='Payment')
tree.grid(row=len(labels), column=0, columnspan=2, padx=5, pady=5, sticky='nsew')
for course_id, payment in student.payments.items():
tree.insert('', 'end', values=(course_id, f"${payment}"))
save_btn = ttk.Button(details_window, text="Save", command=lambda: self.save_student_changes(student, entries))
save_btn.grid(row=len(labels)+1, column=1, padx=5, pady=10)
if __name__=="__main__":
unittest.main()
When I run this test, it says 0 tests. How can I fix?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

Name three of the practices or protections of hazard mitigation.

Answered: 1 week ago

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago