mirror of
https://github.com/nikdoof/mumblepy.git
synced 2025-12-13 06:22:17 +00:00
Add a basic testing framework using Vagrant.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -34,4 +34,6 @@ nosetests.xml
|
||||
.project
|
||||
.pydevproject
|
||||
|
||||
.idea
|
||||
.idea
|
||||
.vagrant
|
||||
!.vagrant/provision.sh
|
||||
13
.vagrant/provision.sh
Normal file
13
.vagrant/provision.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
export DEBIAN_FRONTEND noninteractive
|
||||
echo "APT::Get::Install-Recommends \"0\";" >> /etc/apt/apt.conf.d/99local
|
||||
echo "APT::Get::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/99local
|
||||
echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache
|
||||
apt-get -qq update
|
||||
apt-get install -y python-software-properties
|
||||
add-apt-repository ppa:mumble/release
|
||||
apt-get -qq update
|
||||
apt-get install -y mumble-server python-zeroc-ice zeroc-ice
|
||||
sed -i 's/^icesecretwrite=$/icesecretwrite=test/g' /etc/mumble-server.ini
|
||||
/etc/init.d/mumble-server restart
|
||||
7
Vagrantfile
vendored
Normal file
7
Vagrantfile
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "base"
|
||||
config.vm.provision :shell, :path => ".vagrant/provision.sh"
|
||||
end
|
||||
@@ -1,3 +1,5 @@
|
||||
from .meta import Meta
|
||||
from .hooks import *
|
||||
from .server import Server
|
||||
from .server import Server
|
||||
|
||||
__version__ = '0.1.0'
|
||||
3
setup.py
3
setup.py
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# coding=utf-8
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
@@ -7,7 +8,7 @@ DESCRIPTION = 'Python Mumble for Humans™'
|
||||
with open('README.md') as f:
|
||||
LONG_DESCRIPTION = f.read()
|
||||
|
||||
VERSION = '0.1.0'
|
||||
from mumble import __version__ as VERSION
|
||||
|
||||
setup(
|
||||
name='mumble',
|
||||
|
||||
1
tests/__init__.py
Normal file
1
tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__author__ = 'nikdoof'
|
||||
33
tests/test_mumble.py
Normal file
33
tests/test_mumble.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import unittest
|
||||
import mumble
|
||||
import Ice
|
||||
|
||||
|
||||
class ChannelTests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.meta = mumble.Meta('test')
|
||||
self.server = self.meta.get_server(1)
|
||||
|
||||
def tearDown(self):
|
||||
for chan in self.server.get_channels():
|
||||
if chan.id != 0:
|
||||
chan.delete()
|
||||
|
||||
def testGetRoot(self):
|
||||
chan = self.server.get_channel(0)
|
||||
self.assertEqual(chan.id, 0)
|
||||
self.assertEqual(chan.name, 'Root')
|
||||
self.assertEqual(chan.parent, None)
|
||||
self.assertEqual(chan.description, '')
|
||||
self.assertEqual(chan.links, [])
|
||||
self.assertEqual(chan.position, 0)
|
||||
self.assertEqual(chan.temporary, False)
|
||||
|
||||
def testChannelSetting(self):
|
||||
channel_id = self.server.add_channel('channelSetting', 0)
|
||||
chan = self.server.get_channel(channel_id)
|
||||
self.assertEqual(chan.name, 'channelSetting')
|
||||
chan.update(name='channelSetting1')
|
||||
self.assertEqual(chan.name, 'channelSetting1')
|
||||
|
||||
Reference in New Issue
Block a user