Touch up tests and add pyqtSlot for marks.

Small code review changes.
This commit is contained in:
Ryan Roden-Corrent 2016-04-20 21:53:12 -04:00
parent 0755e163bb
commit 600b5082a9
2 changed files with 18 additions and 17 deletions

View File

@ -21,7 +21,7 @@
import functools
from PyQt5.QtCore import pyqtSignal, Qt, QObject, QEvent
from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QObject, QEvent
from PyQt5.QtWidgets import QApplication
from qutebrowser.keyinput import modeparsers, keyparser
@ -271,6 +271,7 @@ class ModeManager(QObject):
raise cmdexc.CommandError("Mode {} does not exist!".format(mode))
self.enter(m, 'command')
@pyqtSlot(str, str)
def leave(self, mode, reason=None):
"""Leave a key mode.

View File

@ -8,12 +8,12 @@ Feature: Setting positional marks
Scenario: Setting and jumping to a local mark
When I run :scroll-px 5 10
And I run :set-mark 'a'
And I run :set-mark a
And I run :scroll-px 0 20
And I run :jump-mark 'a'
And I run :jump-mark a
Then the page should be scrolled to 5 10
Scenario: Jumping back jumping to a particular percentage
Scenario: Jumping back after jumping to a particular percentage
When I run :scroll-px 10 20
And I run :scroll-perc 100
And I run :jump-mark "'"
@ -21,47 +21,47 @@ Feature: Setting positional marks
Scenario: Setting the same local mark on another page
When I run :scroll-px 5 10
And I run :set-mark 'a'
And I run :set-mark a
And I open data/marks.html
And I run :scroll-px 0 20
And I run :set-mark 'a'
And I run :jump-mark 'a'
And I run :set-mark a
And I run :jump-mark a
Then the page should be scrolled to 0 20
Scenario: Jumping to a local mark after returning to a page
When I run :scroll-px 5 10
And I run :set-mark 'a'
And I run :set-mark a
And I open data/numbers/1.txt
And I run :set-mark 'a'
And I run :set-mark a
And I open data/marks.html
And I run :jump-mark 'a'
And I run :jump-mark a
Then the page should be scrolled to 5 10
Scenario: Setting and jumping to a global mark
When I run :scroll-px 5 20
And I run :set-mark 'A'
And I run :set-mark A
And I open data/numbers/1.txt
And I run :jump-mark 'A'
And I run :jump-mark A
Then data/marks.html should be loaded
And the page should be scrolled to 5 20
Scenario: Jumping to an unset mark
When I run :jump-mark 'b'
When I run :jump-mark b
Then the error "Mark b is not set" should be shown
Scenario: Jumping to a local mark that was set on another page
When I run :set-mark 'b'
When I run :set-mark b
And I open data/numbers/1.txt
And I run :jump-mark 'b'
And I run :jump-mark b
Then the error "Mark b is not set" should be shown
Scenario: Jumping to a local mark after changing fragments
When I open data/marks.html#top
And I run :scroll 'top'
And I run :scroll-px 10 10
And I run :set-mark 'a'
And I run :set-mark a
When I open data/marks.html#bottom
And I run :jump-mark 'a'
And I run :jump-mark a
Then the page should be scrolled to 10 10
Scenario: Jumping back after following a link