Skip to content

Commit

Permalink
Merge branch 'master' into account-ban
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Jul 19, 2024
2 parents cadc8f9 + b3f2566 commit cf1231d
Show file tree
Hide file tree
Showing 75 changed files with 2,359 additions and 345 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
insert_final_newline = true
indent_style = space

[*.py]
indent_size = 4
max_line_length = 79
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto
sandbox export-ignore
.git* export-ignore
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ jobs:
build:

runs-on: ${{ matrix.runs-on }}
timeout-minutes: 10
strategy:
matrix:
include:
- python-version: "3.12.0-alpha.7"
- python-version: "3.13.0-alpha.6"
with-opt-deps: false # https://github.com/pyca/cryptography/issues/10806
runs-on: ubuntu-22.04

- python-version: "3.12.0"
with-opt-deps: true
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -66,7 +71,7 @@ jobs:

- name: Upgrade pip
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pip setuptools
- name: Install optional dependencies
if: ${{ matrix.with-opt-deps }}
Expand All @@ -83,9 +88,9 @@ jobs:
supybot-test test -v --plugins-dir=./plugins/ --no-network
- name: Test with irctest
if: "${{ matrix.with-opt-deps && matrix.python-version != 'pypy-3.7' && matrix.python-version != 'pypy-3.9' }}"
if: "${{ matrix.with-opt-deps && matrix.python-version != '3.7' && matrix.python-version != 'pypy-3.7' && matrix.python-version != 'pypy-3.9' }}"
run: |
git clone https://github.com/ProgVal/irctest.git
git clone https://github.com/progval/irctest.git
cd irctest
pip3 install -r requirements.txt
make limnoria PYTEST_ARGS=-vs
10 changes: 3 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ Last rule: you shouldn't add a mandatory dependency. Limnoria does not
come with any (besides Python), so please try to keep all dependencies
optional.

[Style Guidelines]:https://limnoria.readthedocs.io/en/latest/develop/style.html
[Style Guidelines]:https://docs.limnoria.net/develop/style.html

## Sending patches

When you send a pull request, **send it to the testing branch**.
It will be merged to master when it's considered to be stable enough to be
supported.

Don't fear that you spam Limnoria by sending many pull requests. According
to @ProgVal, it's easier for them to accept pull requests than to
cherry-pick everything manually.
Expand All @@ -32,6 +28,6 @@ is very appreciated.

See also [Contributing to Limnoria] at [Limnoria documentation].

[Contributing to Limnoria]:https://limnoria.readthedocs.io/en/latest/contribute/index.html
[Contributing to Limnoria]:https://docs.limnoria.net/contribute/index.html

[Limnoria documentation]:https://limnoria.readthedocs.io/
[Limnoria documentation]:https://docs.limnoria.net/
30 changes: 19 additions & 11 deletions plugins/Admin/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def getAfterJoinMessages():
self.irc.feedMsg(ircmsgs.join('#Baz', prefix=self.prefix))
getAfterJoinMessages()
self.assertRegexp('channels', '#bar, #Baz, and #foo')
self.assertNotRegexp('config networks.test.channels', '.*#foo.*')

def testIgnoreAddRemove(self):
self.assertNotError('admin ignore add foo!bar@baz')
Expand Down Expand Up @@ -87,13 +88,16 @@ def testCapabilityRemove(self):
ircdb.users.delUser(u.id)

def testJoin(self):
m = self.getMsg('join #foo')
self.assertEqual(m.command, 'JOIN')
self.assertEqual(m.args[0], '#foo')
m = self.getMsg('join #foo key')
self.assertEqual(m.command, 'JOIN')
self.assertEqual(m.args[0], '#foo')
self.assertEqual(m.args[1], 'key')
try:
m = self.getMsg('join #foo')
self.assertEqual(m.command, 'JOIN')
self.assertEqual(m.args[0], '#foo')
m = self.getMsg('join #foo key')
self.assertEqual(m.command, 'JOIN')
self.assertEqual(m.args[0], '#foo')
self.assertEqual(m.args[1], 'key')
finally:
conf.supybot.networks.test.channels.setValue('')

def testNick(self):
try:
Expand All @@ -107,10 +111,13 @@ def testAddCapabilityOwner(self):
self.assertError('admin capability add %s owner' % self.nick)

def testJoinOnOwnerInvite(self):
self.irc.feedMsg(ircmsgs.invite(conf.supybot.nick(), '#foo', prefix=self.prefix))
m = self.getMsg(' ')
self.assertEqual(m.command, 'JOIN')
self.assertEqual(m.args[0], '#foo')
try:
self.irc.feedMsg(ircmsgs.invite(conf.supybot.nick(), '#foo', prefix=self.prefix))
m = self.getMsg(' ')
self.assertEqual(m.command, 'JOIN')
self.assertEqual(m.args[0], '#foo')
finally:
conf.supybot.networks.test.channels.setValue('')

def testNoJoinOnUnprivilegedInvite(self):
try:
Expand All @@ -121,6 +128,7 @@ def testNoJoinOnUnprivilegedInvite(self):
'Error: "somecommand" is not a valid command.')
finally:
world.testing = True
self.assertNotRegexp('config networks.test.channels', '.*#foo.*')

def testAcmd(self):
self.irc.feedMsg(ircmsgs.join('#foo', prefix=self.prefix))
Expand Down
Loading

0 comments on commit cf1231d

Please sign in to comment.