Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/b/i/big-brother-bot-HEAD/tests/parsers/test_ravaged.py   big-brother-bot(Download)
from b3.config import XmlConfigParser
from b3.fake import FakeClient
from b3.parsers.ravaged import RavagedParser, TEAM_SCAVENGERS, TEAM_RESISTANCE
from b3.plugins.admin import AdminPlugin
 
        self.parser.route_game_event('''Round finished, winning team is "0"''')
        # THEN
        self.assert_has_event('EVT_GAME_ROUND_END', data=TEAM_SCAVENGERS)
 
 
    def test_connected_client__guid(self):
        # GIVEN
        self.parser.clients.newClient(cid="12312312312312312", guid="12312312312312312", name="courgette", team=TEAM_SCAVENGERS)
        self.assertEqual(2, len(self.parser.clients))
        self.assertDictContainsSubset({'clients': 2}, self.parser.storage.getCounts())
        self.assertEqual("12312312312312312", client.guid)
        self.assertEqual("courgette", client.name)
        self.assertEqual(TEAM_SCAVENGERS, client.team)
        self.assertTrue(client.authed)
        self.assertEqual(2, len(self.parser.clients))
    def test_connected_client__guid_different_name(self):
        # GIVEN
        self.parser.clients.newClient(cid="12312312312312312", guid="12312312312312312", name="courgette", team=TEAM_SCAVENGERS)
        self.assertEqual(2, len(self.parser.clients))
        self.assertDictContainsSubset({'clients': 2}, self.parser.storage.getCounts())

src/b/3/b3-1.9.2/tests/parsers/test_ravaged.py   b3(Download)
from b3.config import XmlConfigParser
from b3.fake import FakeClient
from b3.parsers.ravaged import RavagedParser, TEAM_SCAVENGERS, TEAM_RESISTANCE
from b3.plugins.admin import AdminPlugin
 
        self.parser.route_game_event('''Round finished, winning team is "0"''')
        # THEN
        self.assert_has_event('EVT_GAME_ROUND_END', data=TEAM_SCAVENGERS)
 
 
    def test_connected_client__guid(self):
        # GIVEN
        self.parser.clients.newClient(cid="12312312312312312", guid="12312312312312312", name="courgette", team=TEAM_SCAVENGERS)
        self.assertEqual(2, len(self.parser.clients))
        self.assertDictContainsSubset({'clients': 2}, self.parser.storage.getCounts())
        self.assertEqual("12312312312312312", client.guid)
        self.assertEqual("courgette", client.name)
        self.assertEqual(TEAM_SCAVENGERS, client.team)
        self.assertTrue(client.authed)
        self.assertEqual(2, len(self.parser.clients))
    def test_connected_client__guid_different_name(self):
        # GIVEN
        self.parser.clients.newClient(cid="12312312312312312", guid="12312312312312312", name="courgette", team=TEAM_SCAVENGERS)
        self.assertEqual(2, len(self.parser.clients))
        self.assertDictContainsSubset({'clients': 2}, self.parser.storage.getCounts())