def test_filter_release(self):
     """Are solution and skip cells filtered out when solution=False?"""
     self.preprocessor.solution = False
     cells = self.preprocessor._filter_cells(self.cells)
     for cell in cells:
         cell_type = util.get_assignment_cell_type(cell)
         assert cell_type != "skip"
         assert cell_type != "solution"
Esempio n. 2
0
def test_get_assignment_cell_type_default():
    """Is the cell type '-' when the assignment metadata is missing?"""
    cell = NotebookNode()
    cell.metadata = {}
    cell_type = util.get_assignment_cell_type(cell)
    assert cell_type == '-'
Esempio n. 3
0
def test_get_assignment_cell_type_given():
    """Is the cell type correct when the assignment metadata is present?"""
    cell = NotebookNode()
    cell.metadata = dict(assignment=dict(cell_type="foo"))
    cell_type = util.get_assignment_cell_type(cell)
    assert cell_type == "foo"