Testing http requests with mock or HTTMock?

So, these days I was working in a project that uses requests to make some http/https calls:

import requests


URL = 'https://us.api.battle.net/wow/auction/data/{}?locale=en_US'
API = 'myapikey'

def request_with_api(url):
    apikey = {'apikey': API}
    return requests.get(url, params=apikey)


def get_auctions_url(realm):
    url = URL.format(realm)
    r = request_with_api(url)
    if r.status_code == 200:
        data = r.json()
        data_url = data['files'][0]['url']
        return data_url
    return None


def get_auctions(realm):
    url = get_auctions_url(realm)
    if url:
        r = request_with_api(url)
        if r.status_code == 200:
            return r.json()
        else:
            raise Exception('Error in return code: %s' % r.status_code)
    else:
        raise Exception('Auction data not found')


if __name__ == '__main__':
    auctions = get_auctions('medivh')
    print auctions

And as usual, I wanted to have my unit tests, and requests is very tricky, because, you don’t want to keep making requests to the real server, every time you run your unit tests, and here is a couple of reasons:

  1. I’ll depend of internet to access the server all the time
  2. The server has a limit of requests that I don’t want to waste testing
  3. Some servers may block your account if you do too many requests in a small amount of time.

Mocking

So, the easiest way to test would be using mock, and then do something like this:

import unittest
import mock

import wow

from wow import request_with_api

class TestWow(unittest.TestCase):

    @mock.patch('wow.request_with_api')
    def test_get_auctions_url(self, wow_patch):
        wow_patch.return_value.status_code = 200
        wow_patch.return_value.json.return_value = {'files': [
            {'url': ('http://auction-api-us.worldofwarcraft.com/'
                     'auction-data')}
        ]}
        data = wow.get_auctions_url('medivh')
        wow_patch.assert_called_once()
        self.assertEquals(data,
                'http://auction-api-us.worldofwarcraft.com/auction-data')

        wow_patch.reset_mock()
        wow_patch.return_value.status_code = 403
        data = wow.get_auctions_url('medivh')
        wow_patch.assert_called_once()
        self.assertIsNone(data)


if __name__ == '__main__':
    unittest.main()

This looks good, all I have to do is set the mock return values, reset the mock, set the values of the status_code, the return of the r.json() value, and all of this inside our tests. Of course, I could create the setUp method, and configure the values there:

import unittest
import mock

import wow

from wow import request_with_api

class TestWow(unittest.TestCase):
    def setUp(self):
        self.ok_return = ('http://auction-api-us.worldofwarcraft.com/'
                          'auction-data')
        self.json_ok_return = {
            'files': [
                {
                    'url': self.ok_return
                }
            ]
        }

    @mock.patch('wow.request_with_api')
    def test_get_auctions_url(self, wow_patch):
        wow_patch.return_value.status_code = 200
        wow_patch.return_value.json.return_value = self.json_ok_return
        data = wow.get_auctions_url('medivh')
        wow_patch.assert_called_once()
        self.assertEquals(data, self.ok_return)

        wow_patch.reset_mock()

        wow_patch.return_value.status_code = 403
        data = wow.get_auctions_url('medivh')
        wow_patch.assert_called_once()
        self.assertIsNone(data)


if __name__ == '__main__':
    unittest.main()

Now, so far, we are only testing the get_auctions_url method, let’s add the test to get_auctions method, who calls the get_auctions_url method as well:

import unittest
import mock

import wow


class TestWow(unittest.TestCase):
    def setUp(self):
        self.ok_return = ('http://auction-api-us.worldofwarcraft.com/'
                          'auction-data')
        self.json_ok_return = {
            'files': [
                {
                    'url': self.ok_return
                }
            ]
        }

        self.json_auction_data = {
            'content': {
                "realms": [
                    {"name": "Medivh", "slug": "medivh"},
                    {"name": "Exodar", "slug": "exodar"}
                ],
                "auctions": [
                    {
                        "auc": 1283349179, "item": 129158,
                        "owner": "Toiletcow",
                        "ownerRealm": "Medivh", "bid": 8360, "buyout": 8800,
                        "quantity": 1, "timeLeft": "LONG", "rand": 0,
                        "seed": 0, "context": 0
                    }
                ]
            }
        }

    @mock.patch('wow.request_with_api')
    def test_get_auctions_url(self, wow_patch):
        wow_patch.return_value.status_code = 200
        wow_patch.return_value.json.return_value = self.json_ok_return
        data = wow.get_auctions_url('medivh')
        wow_patch.assert_called_once()
        self.assertEquals(data, self.ok_return)

        wow_patch.reset_mock()

        wow_patch.return_value.status_code = 403
        data = wow.get_auctions_url('medivh')
        wow_patch.assert_called_once()
        self.assertIsNone(data)

    @mock.patch('wow.get_auctions_url')
    @mock.patch('wow.request_with_api')
    def test_get_auctions(self, request_with_api_mock,
                          get_auctions_url_mock):
        get_auctions_url_mock.return_value = None
        self.assertRaises(Exception, wow.get_auctions, 'medivh')
        get_auctions_url_mock.assert_called_once()

        get_auctions_url_mock.reset_mock()

        request_with_api_mock.return_value.status_code = 200
        request_with_api_mock.return_value.json.return_value = (
                self.json_auction_data)
        get_auctions_url_mock.return_value = self.ok_return
        get_auctions_url_mock.json.return_value = self.json_auction_data
        data = wow.get_auctions('medivh')
        self.assertDictEqual(data, self.json_auction_data)


if __name__ == '__main__':
    unittest.main()

So, now things are starting to get a little bit messy, here we need to mock both wow.get_auctions_url, and wow.request_with_api, and reset the mocks and assert that the mock is being called once. It works, but still, it’as a mess for the next guy who will check this code.

HTTMock

The coolest part of the HTTMock is that it returns a requests object for you, which means you can call other requests method if you need it without the need of mock these methods. In our example, we only mocked the json() and status_code, but imagine if we had to mock the headers, responses, etc. HTTMock do that for you.

In my opinion, HTTMock keeps your test methods more clean:

import unittest
from httmock import urlmatch, HTTMock

import wow


@urlmatch(netloc=r'(.*\.)?us\.api\.battle\.net.*$')
def auctions_url(url, request):
    not_found = ('http://auction-api-us.worldofwarcraft.com/'
                 'auction-data/notfound')
    found = 'http://auction-api-us.worldofwarcraft.com/auction-data'

    if 'fail' in url.path:
        return {'status_code': 403}

    return {
           'status_code': 200,
           'content':
           {
               'files': [
                   {'url': not_found if 'notfound' in url.path else found}
               ]
           }
       }


class TestAuctions(unittest.TestCase):

    def test_get_auctions_url(self):
        with HTTMock(auctions_url):
            data = wow.get_auctions_url('medivh')
            self.assertEquals(data, ('http://auction-api-us.worldofwarcraft.'
                                     'com/auction-data'))

        with HTTMock(auctions_url):
            data = wow.get_auctions_url('fail')
            self.assertIsNone(data)

if __name__ == '__main__':
    unittest.main()

As you can see, we can set a method with the @urlmatch decorator and all requests that match that particular regular expression will be handle by this method.
Inside that method we also can set some conditionals as I did to test when we have ‘not found’.
Of course, there are other decorators. You can use, for example the @all_requests decorator

import unittest
from httmock import all_requests, HTTMock

import wow


@all_requests
def auctions_url_req(url, request):
    not_found = ('http://auction-api-us.worldofwarcraft.com/'
                 'auction-data/notfound')
    found = 'http://auction-api-us.worldofwarcraft.com/auction-data'
    if 'fail' in url.path:
        return {'status_code': 403}

    return {
           'status_code': 200,
           'content':
           {
               'files': [
                   {'url': not_found if 'notfound' in url.path else found}
               ]
           }
       }


class TestAuctions(unittest.TestCase):

    def test_get_auctions_url(self):
        with HTTMock(auctions_url_req):
            data = wow.get_auctions_url('medivh')
            self.assertEquals(data, ('http://auction-api-us.worldofwarcraft.'
                                     'com/auction-data'))

        with HTTMock(auctions_url_req):
            data = wow.get_auctions_url('fail')
            self.assertIsNone(data)

if __name__ == '__main__':
    unittest.main()

In this case, all the requests you do no matter the URL, will be handled by the auctions_url_req:

import requests

with HTTMock(auctions_url_req):
    data = requests.get('https://www.google.com')
    print(data.status_code)
    print(data.json())

And you get this output:

200
{u'files': [{u'url': u'http://auction-api-us.worldofwarcraft.com/auction-data'}]}

Bottom line

Use or not to use HTTMock is up to you, I believe this can make your tests cleaner, it’s much more easy look to a with HTTMock and say: oh, hey, so, this will return whatever is in the with method, cool!
While using mock only, I have to be like, okay… this object is a mock, and the returned value of this method here is 200, and oh, it’s resetting the mock here, so let’s forget about all of this, and start over with the… well, you get the idea.
And of course, you can use more than one method to handle the requests, as you can see on line 65:

import unittest
from httmock import urlmatch, HTTMock, all_requests

import wow

AUCTION_CONTENT = {
    "realms": [
        {"name": "Medivh", "slug": "medivh"},
        {"name": "Exodar", "slug": "exodar"}
    ],
    "auctions": [
        {
            "auc": 1283349179, "item": 129158,
            "owner": "Toiletcow",
            "ownerRealm": "Medivh", "bid": 8360, "buyout": 8800,
            "quantity": 1, "timeLeft": "LONG", "rand": 0,
            "seed": 0, "context": 0
         }
    ]
}


@urlmatch(netloc=r'(.*\.)?us\.api\.battle\.net.*$')
def auctions_url(url, request):
    not_found = ('http://auction-api-us.worldofwarcraft.com/'
                 'auction-data/notfound')
    found = 'http://auction-api-us.worldofwarcraft.com/auction-data'

    if 'fail' in url.path:
        return {'status_code': 403}

    return {
           'status_code': 200,
           'content':
           {
               'files': [
                   {'url': not_found if 'notfound' in url.path else found}
               ]
           }
       }


@urlmatch(path=r'^\/auction\-data.*$')
def auctions(url, request):
    if 'notfound' in url.path:
        return {'status_code': 404}

    return {'status_code': 200,
            'content': AUCTION_CONTENT}


class TestAuctions(unittest.TestCase):

    def test_get_auctions_url(self):
        with HTTMock(auctions_url_req):
            data = wow.get_auctions_url('medivh')
            self.assertEquals(data, ('http://auction-api-us.worldofwarcraft.'
                                     'com/auction-data'))

        with HTTMock(auctions_url_req):
            data = wow.get_auctions_url('fail')
            self.assertIsNone(data)

    def test_get_auctions(self):
        with HTTMock(auctions, auctions_url):
            data = wow.get_auctions('medivh')
            self.assertDictEqual(data, AUCTION_CONTENT)

        with HTTMock(auctions, auctions_url):
            self.assertRaises(Exception, wow.get_auctions, 'notfound')

if __name__ == '__main__':
    unittest.main()
    import requests

And that’s it! Now you have two choices to test your python code that uses requests.

Writing tests in python for beginners – Part 1 – doctest

So, I just started an interest on python tests and I would like to share what I learned so far.

Let’s skip all that theory about how tests are important for the code, bla bla bla, if you want to learn test, probably you already have your own reason, so, let’s jump to the part you actually write code!

Our application

Here a  simple code that calculates fibonacci. Let’s save it in the file fibonacci.py

def fibonacci(number):
    if number < 2:
        return number
    return fibonacci(number - 1) + fibonacci(number - 2)

So, as you can see, it’s a very simple code that calculates the fibonacci number, so, how can we ensure that this is working? Well, the easiest way is just invoke the code with different values, and check if the result will be the expected. So, in other words, you’re doing exactly what doctest intent to do!
so, probably you would write a python file, let’s say, test_fibonacci.py with the following content:

from fibonacci import fibonacci

def test_fibonacci():
    expected_result = [0, 1, 1, 2, 3, 5]
    for x in range(0, 5):
        result = fibonacci(x)
        if result != expected_result[x]:
            print "Failing on calculate fibonacci %s" % x

if __name__ == '__main__':
    print "Testing fibonacci"
    test_fibonacci()

Well, it might work, until you want to calculate fibonacci(200), then you gonna need to add a new list, alter the test code, etc.
What if we now only accept positive numbers and negative numberes throws an exception? Try/catch block? Well, soon you’re writing more code, and adding more complexity than you were expecting. Maybe you gonna need to test your test code itself to ensure that it’s working fine (are you feeling the inception here?)

Doctest

So, doctest can help you with some of these problems! Let’s see, first of all, you’re gonna need to create a simple txt file and add the following content:

>>> from fibonacci import fibonacci

>>> fibonacci(0)
0

>>> fibonacci(1)
1

>>> fibonacci(2)
1

>>> fibonacci(3)
2

>>> fibonacci(4)
3

>>> fibonacci(7)
12

So, basically, doctest expect every line starting with “>>>” to be a python code (we are importing fibonacci function in the line number 1 for example. And any other line as the result, looking just like the python shell.

Assuming that both fibonacci.py and fibonacci.txt are in the same directory, you can run the doctest with the command:

$ python -m doctest fibonacci.txt
**********************************************************************
File "fibonacci.txt", line 18, in fibonacci.txt
Failed example:
    fibonacci(7)
Expected:
    12
Got:
    13
**********************************************************************
1 items had failures:
   1 of   7 in fibonacci.txt
***Test Failed*** 1 failures.

Oops! Something went wrong! Don’t worry, that was expected. As you can see, the doctest shows a very good output when some error occurs, it shows you the line where the error happened, what was the expected result, and what was the result doctest gots. So, after fixing it, and runing again, we got no error

>>> from fibonacci import fibonacci

>>> fibonacci(0)
0

>>> fibonacci(1)
1

>>> fibonacci(2)
1

>>> fibonacci(3)
2

>>> fibonacci(4)
3

>>> fibonacci(7)
13
$ python -m doctest fibonacci.txt

Now let’s go further, and say: Hey, I don’t want negative numbers to be allowed, I want it to throw an exception. So, in this case, we just need to add a new like in our fibonacci.txt testing the fibonacci(-1) and of course, checking if the result will be an exception.
If we would do that in our test_fibonacci.py code, we should use a try/catch block, call the fibonacci(-1) inside it, and of course, this woudln’t be in the initial loop, and if something goes wrong, you wouldn’t have the cool output from doctest.

So, let’s change our fibonacci.py to not accept negative numbers:

def fibonacci(number):
    if number == 1 or number == 0:
        return number
    if number < 0:
        raise ValueError('Number is negative')
    return fibonacci(number - 1) + fibonacci(number - 2)

Even if we run our doctest after this changes, we got no error, but we are not testing the negative number yet. so, let’s add a fibonacci(-1) in our fibonacci.txt test.

Just a heads up, if we run fibonacci(-1) we will get a exception like this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "fibonacci.py", line 5, in fibonacci
    raise ValueError('Number is negative')
ValueError: Number is negative

And you’re probably thinking that you can copy and paste this error on our fibonacci.txt and it will work, but  what if the file can change? You can add more code on the file, and the line where the error is being raised (in this case, line 5) might change. Being so, doctest only cares about the first and last lines, so our code in fibonacci.txt file will look like this:

>>> fibonacci(-1)
Traceback (most recent call last):
ValueError: Number is negative

And we are done! now we have a set of tests to our fibonacci code!

But what if you don’t want to have a txt and still have your tests? You can write doctest directly in your code on the docstring:

def fibonacci(number):
    '''
    This is a fibonacci function.
    Example of usage:
    >>> fibonacci(0)
    0
    >>> fibonacci(1)
    1
    >>> fibonacci(2)
    1
    >>> fibonacci(3)
    2
    >>> fibonacci(4)
    3
    >>> fibonacci(7)
    13
    >>> fibonacci(-1)
    Traceback (most recent call last):
    ValueError: Number is negative
    '''
    if number == 1 or number == 0:
        return number
    if number < 0:
        raise ValueError('Number is negative')
    return fibonacci(number - 1) + fibonacci(number - 2)

and you can run python -m doctest fibonacci.py.

More

Doctest have more features, as you can see below:

ELLIPISIS

According our fibonacci code, if you pass a negative number, it will raise a ValueError exception with the message ‘Number is negative’. There are some cases, that we don’t need to know which message is returning, we just want to know that an exception is being raised. Another example is when the output is the default __repr__ output, every time is a different memory address and you can’t control it. For this kind of situations, we can use the ELLIPISIS like in the example below.

>>> fibonacci(-1) #doctest: +ELLIPSIS
Traceback (most recent call last):
ValueError: ...

The line containing #doctest: + ELLIPSIS tells to doctest that the ‘…’ can match anything after ‘ValueError: ‘

SKIP

As the name says, it skips a test. This can be usefull when you know that some test is failing due some know bug, but it’s not fixed yet.

>>> fibonacci(-1) #doctest: +ELLIPSIS +SKIP
Traceback (most recent call last):
ValueError: ...

As you can see, you can use the two options, ELLIPSIS and SKIP together.

Conclusion

Tests can be fun and easy, and it helps to keep you code working properly in the whole cycle of development.
For more information about doctest, visit doctest website

gannon’s accolade crowns milestone year with raidersAs he prepares to make a case cheap China Jerseys for selection in the Fiji squad that will fly to Brazil, the former NSW custodian has revealed it would be impossible for anyone to truly know what his future has in store, because he himself doesn’t have a clue.”They’ve got no idea because I’ve got no idea,” Hayne told Cheap nfl jerseys Fairfax Media.A return to rugby league has always been on the cards in most people’s minds, but with his recent sporting expeditions taking him to places like the US and the South Pacific, it appears the Hayne Plane has caught the travel bug.”I definitely like being able to travel, seeing the world,” Hayne told The Daily Telegraph.”And I realise now with my skill set, it enables me to do that. I did other sports too and studied hard at school, and I had a social life.. Once this process is complete you will be picking up digital channels (without using an antenna) on your television set.. Finding Video on Demand and catch up options is extremely difficult, especially using the AppleTV Cheap china Jerseys interface, which offers no tab for finding VOD. Fortunately, the Eagles actually managed to get a couple of first downs on their Cheap Football Jerseys next possession that ended with a 38 yard Caleb Sturigs FG to cut the lead to 24 17. Right now, Fox Sports 1 is said to be earning 80 cents to a dollar per subscriber. And that’s what you need to be doing right now. Seal tight with fry pan lid.12. But if a player of his ilk was scouted by the NFL at nfl jerseys cheap an early age, who knows? Bottom line: players who leave the Blues do really well elsewhere.The lightweight loosie with the speed, agility and ferocity to make a terrific corner back. Once a specific sport or two is chosen by the child, you can allow him or her to join an organized team.. Watching Nascar seems to be a hobby that many men are addicted to! Here are a few ideas for out of the ordinary gifts many men would love:. I’ll perform it first at normal speed, then Melissa will go through it slow so we can go over some of the finer points. There, Reynolds appeared cheap jordans in Little Words with Fred Astaire and Red Skelton (1950); Weeks With Love, in which she sang Daba Honeymoon with Carleton Carpenter (1950); and Imperium, playing the niece of hotel owner Marjorie Main (1951). When we would see that, immediately you think they’re getting into trouble; that the coaches couldn’t say it in front of everyone. The first time you see it, the foreign sight is jarring cheap ray bans and unsettling. His speed, his strength, his elusiveness as a runner and capacity to stay on his feet are all perfectly suited to the NFL. This is due to the working of the dominant and recessive gene.

C cedilha no Fedora 22

É sempre comum, após um upgrade termos o problema do ç aparecer como ć, para quem usa teclado padrão US. No Fedora 22 eu encontrei essa solução, que para mim foi muito mais simples do que ficar editando um monte de arquivo.

Lembrando que pode ser feito também no modo gráfico com as contra-partes (dconf-editor e im-chooser).

Instale os pacotes gtk3-immodules e gtk3-immodule-xim

sudo dnf install -y gtk3-immodules gtk3-immodule-xim

Alterar o input padrão:

imsettings-switch im-cedilla

Se por algum motivo você ver alguma mensagem desse tipo:

GDBus.Error:org.gtk pilule viagra achat.GDBus.UnmappedGError.Quark._imsettings_2derror_2dquark.Code5: Current desktop isn't targeted by IMSettings.

Por algum motivo, o gnome vem por padrão para não aceitar immodule do teclado, então, temos que alterar isso no dconf

dconf write /org/gnome/settings-daemon/plugins/keyboard/active false

Reinicie a sessão e seja feliz! Ou você pode sempre usar o Alt Gr + c e você terá o ç da mesma forma. É uma questão de se acostumar.

famous basketball players who’ve reigned over the hearts of many”A coach accusing us of diving . Agree to the download and follow the directions on screen.. It’s like a magnet. As a result, australopithecines were able to include fish, turtles and even crocodiles in their diet foods you probably won’t find at the local restaurant, but rich in fatty acids. Research similar products already Cheap NFL Jerseys on the market and gather such information as target market, price, popularity and where it is sold.. Variety is the key to avoiding fitness plateaus, not to mention it keeps your workouts from getting boring. Ernie Banks, Willie Mays and Hank Aaron rode the wave of equality to legendary baseball careers, inspiring generations of children along the way. 2g,h). I know there’s so much that goes into diving, but all of it’s important. There’s nothing like a corset Replica Oakleys to give you that perfect hourglass figure, whether you’ve got it or not! This instructable shows you the construction of a basic boned corset from start to finish. District Court indictment of Michael Vick:. Goggles that have a split strap are good as well, as it helps with adjustment.Open water swimmers will agree that wetsuit ownership iscritical to success. There is no way that you could wholesale jerseys mention that NFL games and then fail to mention the NFL jerseys as it is such wardrobe accessories that make the game as interesting as it is at the end of the day. Demoff said that Kroenke to make sure that this building is everything that he stood up in front of the NFL owners and said it would be. It was suggested, in the wake of Chelsea’s defeat at Newcastle last week, that Frank Lampard is showing his age. For more information regarding the non GAAP financial measures discussed in this letter, please see “Non GAAP Financial Measures” and “Reconciliation cheap jordans of GAAP to Non GAAP Financial Measures” below. I’m scared for my life.”The valet didn’t know what to do and allowed the pair to leave, according to the cheap oakleys affidavit.Crowley and Manziel then drove to Crowley’s car. Ask for names of people to contact, perhaps a hiring manager or director of scouting. See, in reality, many, many, many civil rights activists including Robinson himself had been working to bust through the color barrier for years, patiently putting pressure on the league to make changes. Corresponding functional deficits in terms of loss in visual acuity and visual field correlated closely with the degree of structural damage. During cheap jerseys wholesale their 20 years life they build their homes in the rocky Replica ray bans cliffs where they can see the terrain below them for any small movement.

Página de Exemplo

Esta é uma página de exemplo. É diferente de um post porque ela ficará em um local e será exibida na navegação do seu site (na maioria dos temas). A maioria das pessoas começa com uma página de introdução aos potenciais visitantes do site. Ela pode ser assim:

Olá! Eu sou um bike courrier de dia, ator amador à noite e este é meu blog. Eu moro em São Paulo, tenho um cachorro chamado Tonico e eu gosto de caipirinhas. (E de ser pego pela chuva.)

ou assim:

A XYZ foi fundada em 1971 e desde então vem proporcionando produtos de qualidade a seus clientes. Localizada em Valinhos, XYZ emprega mais de 2.000 pessoas e faz várias contribuições para a comunidade local.

Como um novo usuário do WordPress, você deve ir até o seu painel para excluir essa página e criar novas páginas com seu próprio conteúdo. Divirta-se!

Many wouldn’t even think of that strategy. It was extremely racially charged.. Long’s deal is a 5 year, $57.5 million deal that includes $30 million in guaranteed money according to NFL Network’s bottom line ticker. Measure around this midpoint using a tape measure pulled snug, but not tight.. You can ask James “the blind traveler” Holman all bout it, assuming you have access to a working Ouija board since the guy has been dead for a century and a half. If I’m not wearing bright colors and if I don’t feel lively, it’s not me.”Sometimes lost in the glare of his wardrobe was Sager’s relentless nature as a reporter.. I think some Replica ray bans of the things that we’ve done over the past few years have been to get to 10 6 and that’s not good enough.”. These findings were identical to those of axons in the retinal nerve fibre layer and in the optic nerve anterior to the lamina cribrosa, whose diameters range from 0.6 to 2.0m51.. In response, Gregoire commented:. If you can get a good few coats of primer, you cheap nfl jerseys can put anything on top of it that is compatable with the primer.. Nat. The first night with CPAP therapy may not be very restful. Subscribe to USA TODAYAlready a print edition subscriber, but don’t have a login?Activate your digital access.Manage your account settings. If you have AdBlock enabled on your browser, you may not be able to see the oakley sunglasses outlet Amazon products that I’ve suggested.). (3) Ask what you will Jesus understood that if we are saved and diligently read and study the word of God, it would in turn affect our will and cause our will to be comformed to the will of God. On the other, you have Tivo, the invention that actually changed the face of television. Clowney is an elite prospect,” Sobleski said.. It’s pretty fun. It is known that he, and 12 other siblings, was raised by his mother, Denise Oher who struggled with drug addiction and alcohol. Bernie Sanders just won his seventh straight contest heading into New York. While they need a quarterback, the eighth NBA Jerseys Cheap overall spot is too early for the next top passer, Paxton Lynch. When Kaino missed the All Blacks’ Tri Nations decider against Australia because his wife was expecting, it was felt as keenly as the ray bans sale absence of a safety net below a high wire act.The third piece of an established loose forward triumvirate with Kieran Read and Richie McCaw, Kaino’s influence takes on even greater importance with the injury enforced absence of the No 8 through the early part of this tournament.It took a while, some thought too long, for Kaino to establish himself as a key part of the Cheap NFL Jerseys China All Blacks after making his debut against Ireland at Hamilton in 2006.Capable of imposing physicality one week, the off switch would be flicked the next as Kaino ran down cheap ray bans the channel marked “anonymity”.It took a personally delivered message from Graham Henry during the 2010 Super 14 to snap Kaino out of his comfort zone.

New small project: stackquery-dashboard

I’ve started a new project called stackquery-dashboard. Basically, it’s a web interface to show reports about user contribution in OpenStack, using the stackalytics.com API and part of the code from launchpadstats from  Martina Kollarova.

The first reason I start this project is because stackalytics.com only shows reports for each user, and sometimes managers in companies working with OpenStack, need a overview of all their employees at once, and it’s kinda boring to look for each user and then mount a spreadsheet.

The project have a Web interface, where you can create teams, assign users for these teams and generate reports based on several OpenStack projects (actually, right now it’s only Openstack and Stackforge).

The second reason is because for a long time I wanted to use Python for web, and it was a good opportunity to start.

Flask is really amazing and very easy to learn. I read this book and in one day I was already doing some cool stuff.
Also, since I’m not a Web designer, I had the opportunity to learn about Twitter bootstrap, which is very good for people who have no idea how CSS and JavaScript works and don’t want to waste a lot of time learning before start some project using these technologies.

The project is very simple, and still in the earlier stages. I’m not sure if it will be useful for anyone, but if is, please, let me know. I would be glad to hear about it.

Next steps
  • I need to work on the unit tests (yes, I started the project before create the unit tests, but I’ll fix it soon)
  • Documentation
  • More API’s
  • More types of reports
  • Make the project work with modules so you can have modules enabled for other types of reports
  • Create a config file
  • Save the state in the forms between posts
  • Better message system when delete, update and create teams, users, projects, etc.
  • Can’t think anything else for now.

And if you’re interested, here’s a few screenshots:

Screen Shot 2015-02-05 at 10.56.10 Screen Shot 2015-02-05 at 10.56.17 Screen Shot 2015-02-05 at 10.56.25 <img class="aligncenter size-full wp-image-123" src="https://i2.wp.com/vps106584.vps.ovh.ca/wp-content/uploads/2015/02/Screen-Shot-2015-02-05-at-10.56.39 viagra posologie vidal.png?resize=840%2C498″ alt=”Screen Shot 2015-02-05 at 10.56.39″ srcset=”https://i2.wp.com/arxcruz.net/wp-content/uploads/2015/02/Screen-Shot-2015-02-05-at-10.56.39.png?w=3104 3104w, https://i2.wp.com/arxcruz.net/wp-content/uploads/2015/02/Screen-Shot-2015-02-05-at-10.56.39.png?resize=300%2C178 300w, https://i2.wp.com/arxcruz.net/wp-content/uploads/2015/02/Screen-Shot-2015-02-05-at-10.56.39.png?resize=768%2C456 768w, https://i2.wp.com/arxcruz.net/wp-content/uploads/2015/02/Screen-Shot-2015-02-05-at-10.56.39.png?resize=1024%2C608 1024w, https://i2.wp.com/arxcruz.net/wp-content/uploads/2015/02/Screen-Shot-2015-02-05-at-10.56.39.png?w=1680 1680w, https://i2.wp.com/arxcruz.net/wp-content/uploads/2015/02/Screen-Shot-2015-02-05-at-10.56.39.png?w=2520 2520w” sizes=”(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px” data-recalc-dims=”1″ /> Screen Shot 2015-02-05 at 10.57.08

President Sex Machine would be lucky if that was the end of that issue. Isaiah Crowell heads the attack, but Duke Johnson cheap nfl jerseys will also be a factor.. It’s the app that has forever changed the way we exchange cash and now Venmo has taken us inside their offices to show us just how they created their game changing company. Vulture talked to Captain Robert Travis, President of the Independent Pilots Association and did some independent math, while breaking down the scene in parts to conclude that the runway was 28.829 miles. But, he ‘reasoned’ his way out of a change of heart, and soon enough was back to his party lifestyle.. We submitted it, but both the commodore and Gary’s CO shot cheap football jerseys it down in favor of a last minute plan based on the same tactics the Navy has been using since World War II. Most private placements Cheap Jerseys are subject to Securities and Exchange Commission Regulation D, which aims to provide access to cheap oakleys the capital markets for smaller companies.. The play didn’t have cheap jerseys a good vibe as it was developing Brady had to work his usual footwork magic in the pocket while going through his progressions but then he hit rookie Malcolm Mitchell for a 21 yard gain and a first down. He plays every single game. The land is now part of the University of Pittsburgh. The abs are burning. He is also currently the only athlete to win both an Olympic gold medal and a Super Bowl ring a feat Ebner has a Fake Oakleys realistic chance to emulate.The US sevens side started with defeat on Wednesday (AEST), going down narrowly to Argentina 17 14 in a Pool A thriller before rebounding to blanket hosts Brazil 26 0. Purity achieved a descent amount of fame but with a large promotional push behind him he could have done even more.. And then almost as soon as they set up to oakleys outlet the ball the Yips just happen. Start by holding onto the counter for balance and stand with your feet together. ‘This means you will be able to spend more time safely in the sun in years to come without worrying about the different areas of your body that you have sunburned in the past,’ says Dr Birch Machin.. And very important in terms of writing down your correct scores. I am hoping not to have another one ever again. There is also a goal post in each end zone which is 30 ft tall and 18 ft 6in apart. CSI: Cyber explores the world of internet crime, which is one of most relevant topics out there, right now. Scholarships can be divided between individual athletes in partial amounts to stretch awards to more players.

Zenity is not dead!

First of all, it’s been a while since my last update in this blog, and I will start to write more about all the stuff that I’m doing (right now I’m working a lot with openstack, so be ready for posts about it).

Now let’s go for what matter: Zenity is not dead! I just don’t have enough time to work alone in all 2008-2012 bugs still opened there, but I’m doing what I can, and here’ s the news:

This bug  from 2012 is finally fixed! Seriously, this was my nightmare for a long time, until I found this!.

So, the old behavior:

zenity --warning --text='A b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v'

Then you get this crappy and ugly thing:

Old behaviour

And this happened because GtkLabel normally allocate enough space when you try to resize the window, like this:

Zenity resize

Now you can have the very expected behaviour:

zenity --warning --text='A b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v'

<img class="aligncenter wp-image-99 size-full" src="https://i2.wp.com/vps106584.vps.ovh.ca/wp-content/uploads/2014/05/zenity_current_behaviour.png?resize=590%2C153" alt="New and expected behaviour" srcset="https://i0.wp.com/arxcruz.net/wp-content/uploads/2014/05/zenity_current_behaviour.png?w=590 590w, https://i0.wp.com/arxcruz vente du viagra.net/wp-content/uploads/2014/05/zenity_current_behaviour.png?resize=300%2C78 300w” sizes=”(max-width: 590px) 85vw, 590px” data-recalc-dims=”1″ />

And if you have a huge text and want to resize your window, now you have an –ellipsize option too!!!

zenity --warning --text='A b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v' --ellipsize

Ellipsize behaviour

See the “…” in the middle? That’s what I’m talking about!

So, here’ s what I’m planning to do:

  • Remove all old and deprecated gtk_ calls replacing for the new ones.
  • Add a dialog with several button options (cool huh? I know people are asking for this).
  • Fix several bugs that’s still opened.
  • Launch new versions of zenity often, so distro maintainers can have more work to do :D.

And that’s it for now guys! Zenity is a great project, abandoned but, a great project, and needs all your love. So, if you’re interested, open bugs, send patches, help the project!

A series of buildings dating back at least 1,600 years were discovered underneath the city’s famous Schneller Orphanage which operated on the ray bans sale site from 1860 until the end of the Second World War, when it was turned into an wholesale nfl jersyes army base. On Sunday evening it hit zero with Chris Hughton’s sacking by Norwich City. If the answer Fake Oakleys is “further from,” notice how that feels. This impressive effort showcased the physical prowess that made Bryant a first round selection in the 2010 NFL Draft out of Oklahoma State.. Traditional tag, reverse tag and rattlesnake tag are games kindergarten children enjoy. Overall you should take your time so you don’t get to frustrated at the game, and slowly just take stabs at getting the players you want. Basically, the only difference between human mating rituals and bullfighting is that human mating rituals didn’t give Ernest Hemingway a boner.. Yet they’ve been above average NFL Jerseys Cheap in the red zone and have allowed the fifth fewest points classic bend but don’t break. Consider the following outlandish scenario, if you will: the Clippers are forced to be sold to another owner. So too was the pressure the Boks were exerting on the touchline.Victor Matfield isn’t quite the player he once was, but he’s lost nothing as an aerial forward.The battle playing South Africa is all about dealing with the pressure. Now the question is, there’s a lot of power, there’s a lot of potential power. A man to man defense would be an advantage for players that are quick and that can guard people one on one. Then they whisk the child away to raise her in the woods, in a shack, destitute, with no magic, even though the curse only put her in danger for one single specific day out of 16 entire years. I was afraid of that . Meanwhile, he’s been called wholesale Jerseys everything from a hero cheap football jerseys to a punk, a money grabber, a traitor, a coward, a deserter, and worse.. However, he is also astute as he knows mindless spending can bring even a rich man to his knees and is therefore, moderate in his pursuit of materialistic pleasures.. Fighting Browne in Germany won’t have anything like the same spectator appeal. The above exercise routine is designed to be performed without free weights. It’s easier than you think, since actual boiling, that is bubbles escaping hot water, can only be achieved Fake Oakleys with a “seed” (say a point, preferably sharp, where bubbles can form). “There’s really nobody to blame but me,” Carroll said to his team after the game, ESPN reported. 5a,b). If he was confused them, I imagine he’s going to be even more confused on how I was able to just review it; I can’t say I blame him because I’m confused too.

Clash of Clans Online Hack and Cheat

New –forms option for zenity

This looks good! I know it need’s a little bit more work on the interface but it looks very promising.
I’ve been working on zenity to add a new –forms option based on bug <a href="https://bugzilla.gnome pour viagra.org/show_bug.cgi?id=412493″>#412493 requested by @aurium, and I believe it’s getting pretty good!
Right now I have –add-entry, –add-password and –add-calendar option. I need to work more in the calendar layout.
You can check the new option in the screenshot bellow:

Zenity with --forms option

zenity –forms option in action

If you have any ideas for this new option, feel free to post in comments 🙂

The first five picks of Beckham, Jordy Nelson, Murray, Mathews, and Jimmy Graham are as strong as any first five rounds in the league. As a dietitian, I know that many of my clients have this same mindset. In German, for example, there are three different words for “the” depending on whether the object in question is masculine (“der”), feminine (“die”), or neutral (“das”). Nearly all the runners fell in the ensuing melee, apart from one horse at the very back of the field, who’s jockey ( John Buckingham) had the advantage of seeing the pile up a long time oakley sunglasses before reaching it, Buckingham skillfully pulled around the carnage and jumped the fence cleanly, and Buckingham then began the long run for the finishing post, even with a huge lead in the race was nearly caught in the final furlongs by a horse who had fallen, been remounted and continued to run the course. Unlike the present system, these lengths would be non negotiable. Rest the index finger and middle finger of one hand on the inside of the opposite wrist and you’ll feel an cheap fake oakleys artery throbbing under your fingers. In the real world, good intentions don’t always stand a chance against a bunch of shitheads with AK 47s.”We’re not poor, look at all the war we can afford.”The Battle of Thermopylae (From 300). “We are treating this as an intentional act.”Holloway went onto the sidewalk at least three or four times, according to Zimmerman.Homicide division officials are looking at numerous surveillance videos from the Strip.The person killed in the crash was identified Monday by the Clark County Coroner’s Office as Jessica Valenzuela, 32, of Buckeye, Arizona.. So Liam Messam can return for the Chiefs to play two matches that potentially and in reality had major ramifications for the make up of the Super cheap nfl jerseys Rugby playoffs but can’t play in href=”http://cheapjerseysupply.com/” target=”_blank”>cheap jerseys those playoffs because he hasn’t played four games this season.Of all the decisions made this season, this has got to be the craziest. His award winning novel The Pilo Family Circus, which was also his first novel, brought him fame. It’s a statement he says he hopes will bring attention to police brutality and social jordan sale injustice against minorities. They plan on retiring when they are 65. Margaret’s High School and Wayzata High School during a holiday tournament in St. We make these statements as of February 1st, 2007, and disclaim any fake oakleys duty wholesale jerseys to update them.. Then came those hated Boston Celtics. Due to survival of the fittest, those strains that had lived through an assault of antibiotics went on to breed replicas of themselves.

Como gerar um patch usando o git

Como gerar um patch com o gerenciador de repositórios git

Você quer ajudar no desenvolvimento do seu aplicativo predileto, e não sabe usar o git, ou como gerar um patch com ele? Eis aqui uma pequena receita de bolo:

1 – Baixe o aplicativo do repositório git com o seguinte comando:

git clone git://repositorio.do.aplicativo.git

2 – Suponhamos que você quer criar um patch para ser enviado aos mantenedores do aplicativo em questão, qual a melhor maneira de fazer isso? Na minha opnião é criando um branch para o seu patch com o seguinte comando:

git checkout -b bug_xxxx_exemplo_de_branch

Pronto! Você criou um novo branch, e está pronto para programar!

3 – Programe!

Agora digamos que você fez várias alterações no código, está na hora de gerar o patch equivalent viagra. Antes de mais nada, você precisa adicionar no git as alterações. Então digamos que você modificou o arquivo aplicativo.c e adicionou o arquivo novo_arquivo.c no seu patch, utilize o seguinte comando:

git add aplicativo.c novo_arquivo.c

Claro que você pode usar o git add para cada arquivo que você adicionar também.

Feito isso, vamos comitar essas alterações. Note que o commit nesse caso, não signfica que você estará subindo as alterações que você fez para o repositório git ainda (até porque talvez você não tenha permissão para isso). O commit é apenas para confirmar que você realmente terminou o que estava fazendo e está pronto para gerar o patch.

git commit

Vai aparecer um editor de textos, pedindo para você colocar as notas a respeito do patch. Salve tudo, e pronto! falta só um pouquinho para que você gere o patch, e isso você faz da seguinte maneira:

git format-patch master --stdout > meu_primeiro.patch

E pronto! Um patch novinho em folha para você enviar para o mantenedor do seu aplicativo preferido! E o melhor de tudo, ele só vai precisar executar um único comando para aplicar seu patch.

Antes que eu me esqueça, fez algo que se arrependeu?

git reset HEADˆ

ou

git reset --hard HEAD^

Released this past August, the game sold more than two million copies in its first week. Fake ray bans The score after each quarter determines the winner. cheap nfl jerseys “It wouldn’t surprise me one way or the other, whether he elects to play or whether he elects to retire,” Childress said. This is very similar to a minestrone you can add just about whatever you have in the frig!! I tamed it down a bit with mild Italian sausage; also used baby bellas (I decided I really don care for portobellas). Already cheap nfl jerseys convicted cheap nfl jerseys once of cheating by Goodell in an illegal videotaping scheme in 2007 that predictably came to be known as “SpyGate” the Patriots saw the suspension as an attack on their legitimacy of the four Super Bowl championships earned under Brady and coach Bill Wholesale Jerseys Belichick.. This is a backhand spring again on a floor.. PESCA: Twenty four kickers have ever gone six for six or better. Tell us about the Chargers overtime win, a crushing disappointment for (unintelligible).. Dr Carman earned his doctorate from the University of Texas, Houston, TX, and later trained in neurophysiology at Cornell University, Ithaca, NY, and in neurodegenerative disease at Memorial Sloan Kettering Cancer Center, New York.. Let me tell you what I did next to find legitimate Nike shoe suppliers.. In some parts, there is a tendency for horses to be turned away for the winter and brought back into work in the spring. Lake Arrowhead, west of Big Bear Lake, is very popular for watersports, hiking, skiing, and virtually. It would require the entire European replica oakleys continent to withdraw to inflict on Blatter the mildest cut.. Sections from patients with colorectal carcinoma and breast cancer were used as positive controls. Missed all of last year with a torn ACL and may be still a year away from reaching his full potential. Don Ohlmeyer produced “Monday Night Football” in the 1970s.. The cells labelled with CYP46A1 in the GCL were considered to be RGCs because they also expressed NeuN (a RGC specific marker)29,30,31 in double labeling experiments (Fig. The NFL earns around US$7.2 billion a year through to 2022 while the NBA will earn US$2.7 billion a season until 2025 a massive increase on its previous deal of US$930 discount football jerseys million a year. He made his Major League Baseball debut with the Cleveland Indians in 1975. This was a GREAT way to make really good money in the Madden 12 game, but they REALLY cut back the amount of money that is being given out upon completing a collection. I don’t love the way it objectifies players..

Maré de azar?

Semana santa acabei viajando para a Bahia, e fui passar o fim de semana com meus pais no interior, onde estava rolando uma festa chamada Feira dos caxixis. É uma festa bem antiga, que ocorre há mais de 100 anos na cidade.

Enfim, estava eu lá usando meu macbook, e minha irmã usando o hp dela, quando de repente, os dois param de funcionar. Achei estranho pois não houve nenhuma queda de energia, e mesmo que tivesse, eram para os computadores continuarem ligados, pois havia carga na bateria.

Tentamos sem sucesso religar os computadores, mas nada acontecia. Foi quando nos veio a notícia que houve uma sobrecarga na rede elétrica.

Resultado: o HP teve um prejuízo de no mínimo (pois minha irmã ligou para a assistência técnica e disse o que havia acontecido e o cara disse que provavelmente seria isso) 450 reais para trocar uma placa que conecta a placa de vídeo ao motherboard, enquanto o macbook vai custar 640 reais em uma bateria nova e mais 370 reais na controladora de energia que aparentemente está com defeito.

Estamos tentando junto à Coelba, ver se eles vão ressarcir as nossas perdas, porém eles estão pedindo tanta coisa (nota fiscal do computador, o qual não lembro onde está, número de série, dia que comprou, identidade, cpf etc, etc, etc, que aparentemente é para que acabemos desistindo, ou que demore tanto que quando recebermos um notebook novo ou o nosso consertado, não tenha mais graça.

Acho que no final das contas, vamos ter que ir ao PROCON…

E ai vai começar mais uma luta…

Enquanto isso, só posso falar com minha irmã por telefone, ou por sms, encarecendo a minha conta telefonica, e ainda vou ter que gastar uma nota enviando meu macbook para a Bahia só para a Coelba dizer que ela não tem culpa nenhuma do que aconteceu (elas nunca tem culpa, apenas a gente que usou de maneira indevida colocando pra carregar na tomada)

driver convicted of being a ‘middle lane hogger’ speaks wholesale nfl jerseys outAfterward, if the score is still tied, the game ends in a tie.. There value in fans watching that prospect grow up in front of them, both as a player and a person. Halloween grams should be some type of candy, while Christmas grams would normally have candy canes attached. 3: Auckland, New ZealandAuckland is the largest city in New Zealand and is home to approximately 30% of the country’s population. Wedding gowns with embroidered necklines and bodices are beautifully suited to plus size women with hourglass, pear and rectangular shapes because they draw the attention upwards and emphasize the curve of the waist. This makes sense because it offers an alternative for people who don’t want to suffer through long lines and threats of death by stampede. There is no shortage of such equipment in the market, and you can easily buy the hardware and other safety gear at any regular sports store. But the latest agreement reached two weeks ago eliminated a maximum for the monetary award fund.The NFL will use $75 million for medical tests to help determine if any retired Cheap NFL Jerseys players have brain damage and for treatment.The retired players could receive between $1.5 million and $5 million depending on cheap nfl jerseys their age and the severity of their cognitive impairment. Most players had split freedom for six weeks. Here’s one of my personal favorite stories from my time in the ER: A Replica ray bans couple was seen by their family practice doctor earlier in Cheap NFL Jerseys the day for the wife’s constipation. Our daily lives are bound to that particular place and we somehow end up becoming a part of it as well. The American Marketing Association promotes specific standards of conduct for advertising and Wholesale NFL Jerseys marketing professionals to follow. At this current juncture, this mutual fund is Cheap ray bans not set up well to defend against the downside risk in this market. The macronutrients carbohydrates, protein and fat are sources of calories for your body. In this manner when man imbibes these 14 jewels of ethics true religiosity will bloom in his psyche/soul. Goldberg bought Palace last year for pounds 23m but it soon became apparent that he did not possess adequate financial resources to fund his ambitions for the club. For example, if the speaker’s last name is Crowe: is easy to use (Crowe).. For the second coating I used a 3:1 mixture of graphite to silica. Part 3 on the list of boot camp exercises is the squat. According to Suzanna Harbin, president of the Cullman Board of Education, “Our superintendent, Dr.

Monodevelop 2.0 released

md-subheader1

MonoDevelop 2.0 foi liberado hoje. Mais informações em http://www.monodevelop.com/Download/MonoDevelop_2.0_Released

how to become an nfl coachThese are the weight divisions currently recognized by the World Boxing Association (WBA) and the World Boxing Council (WBC). Offensive linemen and interior defensive linemen must add muscle bulk as well as sheer strength and movement specific power. As time progresses over the two week period, you notice you be able to go deeper into the stretches.. I mean you get those results from anywhere for the most part and you can enable a brand to travel with the product which we try very hard to do, it’s a conversation we’ve actually had with Netflix because it’s important that our brand including the ABC brand but of course the Disney brand and the Marvel brand and the Star Wars Lucas brand we want those discount football jerseys to travel as well because that’s quite important and quite important to the consumer. Nicknamed ‘the Black Spider’, Yashin played for Dynamo Moscow for 20 years, between 1950 and 1970, and also played 78 times for the Soviet Union. We broke up soon after I arrived. Data are expressed as % total brain voxels ( SEM) for several ADC or T2 values. (c) Oxygen extraction fraction (OEF) measurements for the N and O groups. The NFLPA’s longtime head, Gene Upshaw, has made it quite clear neither he nor the union place a priority on legacy players. Maybe. The number of Americans denied voting wholesale football jerseys rights continues to grow despite the general easing of barriers to voting for people with criminal records. (b) Simulated d2EYFP fluorescence of PNFL cells following simulated treatment with doxycycline of different duration . One could argue that most Americans do not follow cheap jerseys that model either but most Americans do not get annual contracts averaging millions of dollars, especially knowing in advance that the income is short term.. PARG110 KO retina is morphologically and functionally normalTo study the importance of nuclear PARG110, we assessed retinal morphology and function cheap oakleys sunglasses in PARG110 KO animals using both in vivo and ex vivo techniques. At least 35 countries are planning to become members by the end of the month.European shares are taking off after new data showed business activity cheap football jerseys china in the eurozone hitting a 46 month high in March. The second line of attack would be catching Big Al on tax evasion, because apparently even bootlegging outlaws are supposed to pay their taxes. Furthermore, if government can find Replica Oakleys ways to make the NFL cheap oakleys sunglasses proposal more financially attractive without spending taxpayers’ money through such devices as tax increment financing and regulatory changes it should do so..