Exemplo n.º 1
0
    def test_get_password_names_grouped_sort2(self, cfg, rand_pw):
        passout.add_password(cfg, "x__aaa", rand_pw)
        passout.add_password(cfg, "x__xxx", rand_pw)
        passout.add_password(cfg, "x__bbb", rand_pw)
        passout.add_password(cfg, "x__www", rand_pw)

        got_dct = passout.get_password_names_grouped()["x"]

        order = [i for i in got_dct]
        assert order == ["aaa", "bbb", "www", "xxx"]
Exemplo n.º 2
0
    def show_menu(self, icon, button, time):
        self.menu = Gtk.Menu()

        menu_dct = get_password_names_grouped()
        self._add_items_to_menu(self.menu, menu_dct)

        sep = Gtk.SeparatorMenuItem()
        sep.show()
        self.menu.append(sep)

        # Exit
        exit = Gtk.MenuItem("Exit")
        exit.show()
        self.menu.append(exit)
        exit.connect('activate', Gtk.main_quit)

        self.menu.popup(None, None, None, None, button, time)
Exemplo n.º 3
0
    def test_get_password_names_grouped(self, cfg, rand_pw):
        passout.add_password(cfg, "pass-1", rand_pw)
        passout.add_password(cfg, "group1__pass1-1", rand_pw)
        passout.add_password(cfg, "group1__group1-1__pass1-1-1", rand_pw)
        passout.add_password(cfg, "group1__group1-1__pass1-1-2", rand_pw)
        passout.add_password(cfg, "group2__pass2-1", rand_pw)

        got_dct = passout.get_password_names_grouped()

        expect_dct = {
            'pass-1': {},
            'group1': {
                'pass1-1': {},
                'group1-1': {
                    'pass1-1-1': {},
                    'pass1-1-2': {},
                },
            },
            'group2': {
                'pass2-1': {}
            },
        }

        assert got_dct == expect_dct
Exemplo n.º 4
0
 def test_get_password_names_grouped_empty(self):
     got_dct = passout.get_password_names_grouped()
     assert got_dct == {}