示例#1
0
class FuckingTests(unittest.TestCase):
    def setUp(self):
        self.f**k = F**k()

    def test_url(self):
        url = self.f**k.off(name='Alice', from_='Bob').url
        self.assertEqual('http://foaas.herokuapp.com/off/Alice/Bob', url)

    def test_url_secure(self):
        secure_fuck = F**k(secure=True)
        url = secure_fuck.everything(from_='Bob', secure=True).url
        self.assertEqual('https://foaas.herokuapp.com/everything/Bob', url)

    def test_url_quoting(self):
        url = self.f**k.donut(name='Alice!', from_='Bobby McGee').url
        self.assertEqual('http://foaas.herokuapp.com/donut/Alice%21/Bobby%20McGee', url)

    def test_html(self):
        html = self.f**k.thanks(from_='Bob').html
        self.assertIn('<h1>F**k you very much.</h1>', html)
        self.assertIn('<em>- Bob</em>', html)

    def test_json(self):
        json = self.f**k.life(from_='Bob').json
        self.assertEqual({
            'message': 'F**k my life.',
            'subtitle': '- Bob'
        }, json)

    def test_text(self):
        text = self.f**k.thanks(from_='Bob').text
        self.assertEqual('F**k you very much. - Bob', text)

    def test_random(self):
        self.f**k.random(from_='Chris')
        self.f**k.random(name='Tom', from_='Chris')
示例#2
0
 def setUp(self):
     self.f**k = F**k()
示例#3
0
class FuckingTests(unittest.TestCase):
    def setUp(self):
        self.f**k = F**k()

    def test_url(self):
        url = self.f**k.off(name='Alice', from_='Bob').url
        self.assertEqual('http://foaas.herokuapp.com/off/Alice/Bob', url)

    def test_url_secure(self):
        secure_fuck = F**k(secure=True)
        url = secure_fuck.everything(from_='Bob', secure=True).url
        self.assertEqual('https://foaas.herokuapp.com/everything/Bob', url)

    def test_url_quoting(self):
        url = self.f**k.donut(name='Alice!', from_='Bobby McGee').url
        self.assertEqual(
            'http://foaas.herokuapp.com/donut/Alice%21/Bobby%20McGee', url)

    def test_html(self):
        html = self.f**k.thanks(from_='Bob').html
        self.assertIn('<h1>F**k you very much.</h1>', html)
        self.assertIn('<em>- Bob</em>', html)

    def test_json(self):
        json = self.f**k.life(from_='Bob').json
        self.assertEqual({
            'message': 'F**k my life.',
            'subtitle': '- Bob'
        }, json)

    def test_text(self):
        text = self.f**k.thanks(from_='Bob').text
        self.assertEqual('F**k you very much. - Bob', text)

    def test_random(self):
        self.f**k.random(from_='Chris')
        self.f**k.random(name='Tom', from_='Chris')
        self.f**k.random(name='Alice', from_='Bob', company='Acme')
        self.f**k.random(name='Alice', from_='Bob', reference='Clara')
示例#4
0
 def test_url_secure(self):
     secure_fuck = F**k(secure=True)
     url = secure_fuck.everything(from_='Bob', secure=True).url
     self.assertEqual('https://foaas.herokuapp.com/everything/Bob', url)
示例#5
0
#!/usr/bin/env python3

import sys
import re
import logging
import logging.config
import random
from random import choice as randchoice
from slackbot import settings
from slackbot.bot import Bot
from slackbot.bot import respond_to
from slackbot.bot import listen_to
from foaas import F**k

f**k = F**k(secure=True)

MAN = ['Evan', 'Matt']
BEAST = ['Shardik', 'Linus']
BOTH = MAN + BEAST

name = random.choice(BOTH)
from_ = random.choice(BOTH)


def choose_random():
    return randchoice(BOTH)


@listen_to('^f**k off$', re.IGNORECASE)
def fuck_off(message):
    """You don't get to tell me to f**k off!"""
示例#6
0
 def setUp(self):
     self.f**k = F**k()
示例#7
0
 def test_url_secure(self):
     secure_fuck = F**k(secure=True)
     url = secure_fuck.everything(from_='Bob', secure=True).url
     self.assertEqual('https://foaas.herokuapp.com/everything/Bob', url)
示例#8
0
    Sub-project: Labs
    File Name: fuckstrings.py
    Author: Dustin McClure
    Lab: Lab 3a - Using Strings
    Modified Date: 10/10/2020

    A program that formats and prints responses from the
    foaas api (F**k off as a Service); an api that allows
    you to very efficiently tell someone or something to
    'f**k off'.
"""
# import the F**k class from the foaas module
from foaas import F**k

# create a new instance of the class F**k
f**k = F**k()

# set variables for the current lab and number of f**k operations
lab_three = 3
fuck_amount = 4

# print a f*****g explanation of what this program accomplishes
# using string modulo operators  %d (digit), %s (string), and
# %f (floating point) to embed values
print('''Today, for lab %da, we will be exploring precisely %.1f
of the many satisfying ways one can use %s off as a service to
simplify the action of telling someone to %s off. \n
''' % (lab_three, fuck_amount, 'f**k', 'f**k'))

print(
    "=====================================================================\n")